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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Mar 4, 2020 at 15:33

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Mar 4, 2020 at 16:34
2
  • well I feel silly now. I guess I just assumed that gdal wouldn't work with arcpy 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. Commented Apr 6, 2021 at 20:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.