ArcGIS Pro project holds the python environment to be used

1118
7
07-09-2019 03:22 PM
AnthonyRyanEQL
Occasional Contributor III

Hi all,

Is there a setting or something within the ArcGIS Pro project that sets which python environment is uses? At the moment, I have 2 users environments (one for the Utility Network Foundation and the other for running scripts in VS code) as they have very different requirements and don't want to have package dependences version issues with the main tools that I'm using.

I'm currently using ArcGIS Pro 2.4 with ArcGIS Enterprise 10.7.1

Thanks

Tags (2)
0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus

Anthony can we assume you have multiple environments that you can activate?

Python Package Manager—ArcPy Get Started | ArcGIS Desktop 

0 Kudos
AnthonyRyanEQL
Occasional Contributor III

Dan,

I definitely do. I have the master (arcgispro-py3) and 2 users envs (un & dev)

0 Kudos
DanPatterson_Retired
MVP Emeritus

so you did...

After changing the active environment, you may need to restart ArcGIS Pro to reinitialize Python and use the new environment.

And if that didn't work, then you need to explore where the packages were in installed

       1                                       2

C:\arc_pro\bin\Python\envs\arcgispro-py3\Lib\site-packages

"1" is the install folder for arcgis pro.

"2" is the environments in the 'envs' folder... you should have the base arcgispro-py3 and 2 others.

I don't bother cloning since I have full admin rights to my machine, but if you want to separate environments that is ok/good.

/blogs/dan_patterson/2018/12/28/clone 

But your packages need to be present in the correct environment.  I always use 'conda' to install/manage my packages

/blogs/dan_patterson/2018/07/01/arcgis-pro-your-conda-environments 

AnthonyRyanEQL
Occasional Contributor III

Dan,

Thanks for this but it's still not what I'm after.

I'm trying to find out if I have 2, 10, whatever number of cloned environments available to use and I have ArcPro open to use one of those environments (eg. one of the environments is setup for Utility Network Foundation), is there a setting in the ArcGIS Pro project that knows to use that environment when it opens every time instead of having to switch & restart if its changed?

Thanks

0 Kudos
JoeBorgione
MVP Emeritus

That's an interesting question.  I just tried it between the default env and my clone.  As you indicate, which ever you use last is what the next project opens up with.  Could be an ideas submission waiting in the wings....

Kory Kramer

That should just about do it....
0 Kudos
DanPatterson_Retired
MVP Emeritus

Ok... now I see what you want.

No.  You have to switch manually and generally/sometimes restart Pro

0 Kudos
AnthonyRyanEQL
Occasional Contributor III

Thanks all for looking at this. I'll submit an idea