How to run python with the ArcGIS Pro 1.4 from outside

9432
37
Jump to solution
03-13-2017 04:00 PM
BidhyanandaYadav
New Contributor II

With ArcGIS Desktop, version 10.4 for example, I installed the Anaconda Python and was able to run all the arcpy scripts from outside of the ArcGIS session (for example with Spyder, or Jupyter Notebook) with the following Desktop10.4.pth file created in site-package with following three lines of code

C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.4\bin
C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolbox\Scripts

I want to replicate the same behaviour with the new ArcGIS Pro 1.4, but there seems no help on how to do this. I want to know how to do this with the Anaconda Python that is installed by default with ArcGIS Pro 1.4. Do I need to install a separate copy of Anaconda Python?

0 Kudos
37 Replies
Bidhya_NYadav
New Contributor

Thank you for the update SWalbridge-esristaff

0 Kudos
HopeWorkswell
New Contributor II

Dear Shaun:

I was working on ArcGIS Pro 2.0.1 version and I also could not import arcpy to another Python version. I used every method you instructed, like adding the arcpy.pth and ArcGISProBin.pth, I also copied three pyd files. When I import arcpy, the outside python will stop working. Because of the nature of my work I have to call arcpy from outside python. I'm using the same python version as the ArcGIS Pro python. If you know where the problem is, let me know! Thank you!

XanderBakker
Esri Esteemed Contributor

Hi Shaun Walbridge , can you confirm that the enhancement is part of the 2.1 release next week?

0 Kudos
DanPatterson_Retired
MVP Emeritus

I am not sure I follow.  I use arcpy in arcmap and ArcGIS pro (even in the new 2.1 beta) all the time).  They are just housed in different locations and they aren't shared.  Anaconda keeps a nice bubble around things.

0 Kudos
HopeWorkswell
New Contributor II

That's too bad to hear. Especially the ArcGIS Pro's python is always not up-to-date.

0 Kudos
DanPatterson_Retired
MVP Emeritus

3.6 coming soon in pro, currently 3.5

It is controlled by Anaconda releases.  If you want to be on bleeding edge, just produce a separate Anaconda distribution for testing, or it is just simpler to follow the discussion on the python lists or simply check on the changelog for python to see what is new

https://docs.python.org/3.7/whatsnew/3.7.html 

Nothing major affecting gis world between 3.6 and 3.7 so you should be good for a year or two.

Numpy, Scipy and matplotlib (plus others) have had major changes in the last few years. and they are/will be as current as Anaconda permits.

If you want python. 3.x... use Pro, or just be careful working with it in ArcMap

0 Kudos
HopeWorkswell
New Contributor II

That's very valuable information, thank you! 

0 Kudos
PhilMorefield
Occasional Contributor III

For what it's worth, I was finally able to get this working. I'm not sure if I was doing some wrong last time, or if the problem was ArcGIS Pro 1.4, but it's working for ArcGIS Pro 2.1 now.

An updated thread is here.

0 Kudos