0

I have a Windows machine with a ArcGIS 10.3.1 (w/ Python 2.7.8) install that the powers that be DO NOT want me to uninstall/reinstall.

I would like to find a way to:

  1. set up some virtual environments (in a way to seperate arcgis-python from other forms of python & packages)
  2. set up pip (since it does not come with this version preinstall)

Is there a way to do this?

My system PATH for python are currently 32-bit:

C:\Python27\ArcGIS10.3;C:\Python27\ArcGIS10.3\Lib\site-packages

2

Can you just add pip and virtualenv to the existing instance of python?

If not you can install a new instance of python in a different folder. I haven't test this workflow with virtualenv but it works with plane scripting. You can then install pip to this instance. Finally you can copy the arcpy path files to the new folder so arcpy will work in the new instance. There is a wealth of info on this thread but here are the broad steps I have used in the past.

  1. Download and install a new version of python 2.7
  2. In this new location set up pip, or if you are using the latest release of python I think it comes preinstalled
  3. Copy the arcpy path files from the arcgis instance, C:\Python27\ArcGIS10.3\Lib\site-packages\Desktop10.3.pth, to your new instance C:\Python27\[new instance]\Lib\site-packages
  4. Use pip to install virtualenv
  5. Use pip to install other packages that arcpy uses that aren't installed by default. I think numpy and matplotlib are the only 2.
1
  • Since we need other packages (such as numpy), i also added one additional line to the ptn file: c:\Python27\ArcGIS10.8\Lib\site-packages\
    – OritK
    Jun 21 '21 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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