Installing Anaconda for Python 3.6 without wrecking Python 2.7

5491
14
Jump to solution
08-13-2018 11:33 AM
JustinBridwell2
Occasional Contributor II

Hey All- I have both Python 2.7 with ArcGIS 10.5 Desktop and Python 3.6 with ArcGIS Pro. A few weeks back, I tried to install Anaconda (w/ Conda, Spyder, Jupyter, etc..) and it somehow overwrote my system settings for Python 2.7 (as well as pip). I noticed that I could no longer use pip or import stuff in 2.7. I uninstall Anaconda and the updated version of pip (it somehow updated the pip version) and everything in 2.7 worked again. Any suggestions on reinstalling Anaconda with wrecking my Python 2.7 development environment again? 

0 Kudos
14 Replies
JustinBridwell2
Occasional Contributor II

This was a difficult question to answer but I was finally able to install Anaconda and having it working with my version of ArcGIS Pro (2.2) and Python (3.6). Most importantly, I can now use both the Jupyter Notebook AND the Spyder IDE. The Jupyter Notebook came bundled with the new version of ArcGIS Pro that I installed, so that issue was taken care of. However, I did a reinstall of Anaconda 3.6 and found that I did not have important packages like arcpy and arcgis (the ArcGIS API for Python essentially). I finally found a a work through that did the trick. Here's a link. Essentially, you have to copy the folder arcgispro-py3 from C:\Program Files\ArcGIS\Pro\bin\Python\envs and paste to C:\Anaconda2\envs. The, rename the copied folder arcgispro-py3 in C:\Anaconda2\envs to arcpro. You have to do 2 main things from there; launch your Anaconda Navigator and check in the Environments tab to make sure that there is an arcpro environment. Then, when you launch Spyder, it will ask you if you want Spyder to access the new arcpro environment. Just click yes. The test it out by typing `:import arcpy`. It should run the code without throwing an error. Finito!

0 Kudos
ShaunWalbridge
Esri Regular Contributor

Justin,

Glad you found a workable option. You should be able to install Anaconda Navigator and Spyder from an ArcGIS environment, but going the other way is also useful. We're working on further improvements to make this process smoother in the future, purely copying the files can have problems if there are hardcoded paths in the files, but if it works, I won't complain!

Cheers,

Shaun

SamGuilford
New Contributor III

Hi Shaun,

Any updates on a smoother process? Trying to run Desktop and Pro as well as Anaconda Python 2.7 32-bit for use in Spyder IDE. This is throwing errors in Pro for basic tools. I'd rather not mess around copying and pasting files if I don't have to. Any official suggestion?

Thank you.

0 Kudos
ShaunWalbridge
Esri Regular Contributor

We don't have a public release of what we're working on for this yet, but it's definitely on our release roadmap. In Pro 2.3, you can link Pro to an external environment, which may be helpful for your needs. If you're just using a 32-bit Anaconda installation, Pro should be entirely separate since it's all 64-bit as is the conda environments it creates. If you're seeing cross-talk in Spyder between Pro and your Anaconda installation, could you share some details of what the error your seeing is and I can try to troubleshoot them?

Cheers, Shaun

JustinBridwell2
Occasional Contributor II

Hey Shauna,

     Great to hear. I reinstalled again and now have an environment for 2.7 in Anaconda. Now I want to have a second environment for Pro with Python 3.6. Can I just copy my env file from Pro and pluck it into my Anaconda env folder as I did for 2.7 or do I need to do something else? Any suggestions?

0 Kudos