ArcGIS Pro 2.1.3 and Python3

1810
18
Jump to solution
06-20-2018 07:00 AM
Highlighted
MVP Regular Contributor

I'm currently in the process of writing/testing scripts with Python3 to be used as Python Scripts Tools with ArcGIS Pro.  I am confused with the Python stack installed with ArcGIS Pro 2.1.  It seems like there is no IDLE- is this true?  Also, if Anaconda comes installed with Pro- how can I create scripts with Python3 to be used in that environment?  Do I need to download Python3 outside of the ArcGIS Pro stack? 

I have downloaded Sublime3 and downloaded Conda within it via the steps outlined here.  But, I still do not know how to test scripts within it that point to the installed packages in the Pro directory.

What is your process of creating/testing scripts to be used with the installed Python3 packages with ArcGIS Pro?

I am very confused and any suggestions or documentation would be greatly appreciated.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Esteemed Contributor

C:\ArcGISPro\bin\Python\envs\arcgispro-py3\pythonw.exe "C:/ArcGISPro/bin/Python/envs/arcgispro-py3/Scripts/spyder-script.py"

I installed ArcGIS Pro in the bold folder... just replace or add to that so from "bin" on is going to be the same.

So you highlight the spyder-script.py in file explorer, then right-click, make shortcut, drag/send to desktop then edit the path to be as shown.  the double quotes are needed aroung the spyder-script section for sure.  

View solution in original post

18 Replies
Highlighted
MVP Esteemed Contributor

Mitch... I am sure you can get it going... but

I switched over to Spyder /blogs/dan_patterson/2018/01/28/spyder 

since it is packaged with the Anaconda distribution for Pro.

I have also installed IPython and Jupyter Notebook all from within the same distribution.

Check my blog for Python 3, and Pro related threads beyond the first post... there are a number

 

Highlighted
MVP Regular Contributor

Thanks, Dan.  So I'll need to download Anaconda and Spyder to interact with the Python3 packages Pro installed?

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Mitch; it's all handled with the Python Package Manager and is super easy.  So easy I was able to it...

Just pick what you want to add from the list and it takes care of the heavy lifting.

Mitch Holley

Dan Patterson

Highlighted
MVP Regular Contributor

Joe, I also have ArcGIS Desktop 10.4 installed and Python 2.7.  I can't figure out how to create/test code for Python3 using the packages/env installed by ArcGIS Pro. 

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

I have desktop 10.5.1 installed on the same machine as ArcGIS Pro.  Typically with ArcGIS Desktop 10.x, your python install directory is C:\Python27  ( or some variant of the version of python) while your ArcGIS Pro installs python in C:\ProgramFiles\ArcGIS\Pro\bin\Python.  As I understand it, (and Dan Pattersonjump in anytime) the Python 3 install is a complete and separate environment, so the two won't clobber each other.  I especially like the Spyder IDE that you can install as a package; I've copied Python 2.x scripts and made edits to them to run in the 3.x environment. 

I'm not sure if I've answered your question, so keep the discussion going: Between Dan, Xander Bakker, Joshua Bixby and a few others that I bet are monitoring this thread, you should be up and running in no time.

Highlighted
MVP Esteemed Contributor

The Pro installation of python is totallllllllly separate, contained and just use what is provided in their

Do not! start fooling around with paths, python thingys or anything else.

If your favorite IDE doesn't work with pro's or you can't figure out how to set it up see the Anaconda doc

referenced by the first link.

Python in ArcGIS Pro—ArcPy Get Started | ArcGIS Desktop under Python IDE's

Integrations | Anaconda: Documentation 

Besides ….. python 3 is a fresh start (which should have started about 10 years ago ) so I recommend "installing",,, through your Package Manager (leave conda installs until later)… give these a try

spyder, IPython and Jupyter...   then your IDE  (I have even installed and used PythonWin for those old school nostalgia moments)

Highlighted
MVP Esteemed Contributor

Progress???

Reply
0 Kudos
Highlighted
MVP Regular Contributor

Dan, thanks for the follow up.  I successfully installed Spyder via the Python Package Manager in ArcGIS Pro, however I can't seem to figure out how to access the IDE.

I tried to create a desktop shortcut via your blog post, but I couldn't figure out the paths.  I haven't had much time to dedicate to this, but I plan on spending some time on it soon.

Reply
0 Kudos