1

I have done a little searching into this topic, but I really don't understand virtual environments, and setting up paths, using visual studio or anaconda all that well, so the when I read any advice I get overwhelmed and confused by it.

But basically I have ArcGIS Pro but also want to run some gdal specific tools in the same script. I was able to create a virtual environment with gdal in it using anaconda and I know how to get the the ArcGIS Pro's virtual environment/python but I can't download one library into the other's environment.

usually when I'm running scripts I am using pycharm and set the python interpreter to one of the two environment's and switch between the two depending on what script I'm using, but this isn't efficient or really working anymore.

Any ideas?

1 Answer 1

4

GDAL 2.1.1 is already installed with the default Python installation in ArcGIS Pro. Any script you create and run within the ArcGIS Pro Python window (or the ESRI installed version of Jupyter) will allow imports of both arcpy and GDAL. See the first image below and this link for more information.

If you want to run Python scripts from a third-party Python IDE (like Wing or Komodo) you will need to set preferences/envoronment settings in those applications to ensure you are pointing to the same version of Python that comes with Pro. I have included a second screen shot showing the location of the Python.exe that installs with Pro.

In Pro, Python is a walled garden. You can make a clone of Python and install third-party packages there. The link above describes that process in more detail.

enter image description here

enter image description here

2
  • well I feel silly now. I guess I just assumed that gdal wouldn't work with arcpy
    – Emtomp
    Commented Mar 4, 2020 at 17:03
  • @GBG The default environment doesn't allow modification by default in large part because upgrading it consistently isn't possible once user-added packages have been installed (largely because of how MSIs operate on existing files). If you're OK with possible upgrade issues, you can install packages into arcgispro-py3 by running a Python Command Prompt session as an administrator.
    – scw
    Commented Apr 6, 2021 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.