Conda Environment Broken in ArcGIS Pro

3491
7
Jump to solution
06-30-2021 08:36 AM
NathanHeickLACSD
Occasional Contributor III

Last night, I was trying to learn about conda and environments and I did the introductory tutorial.  The biggest issue was really running the Python Command Prompt as an administrator.  So, I created a new environment from the Command Prompt using conda install --name and it appears to work just fine.  However, when I try to activate it in ArcGIS Pro, it says it is broken.  I installed pywin32, which caused an upgrade to Python 3.9.  Also, I don't really need all the other libraries in the arcgispro-py3 environment, which is why I started from the base environment versus cloning arcgispro-py3.

My question is basically is this expected?  Are there certain requirements for a conda environment to function in ArcGIS Pro, which is why the software always clones arcgispro-py3?

1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

There is little point in cloning the default arcgispro-py3 environment unless you plan to do mappy things in that environment.  A specific creation and installation of your desired packages to work outside of Pro is safe.  If there are packages that I want to use in the arcgispro-py3 environment, I install them there... if there are issues, they are easily walked back without issue (via conda install revision).  If you are doing the deep learning stuff, only use their frameworks ( Esri/deep-learning-frameworks: Installation support for Deep Learning Frameworks for the ArcGIS Syst... ).  I have installed several python IDEs in the base environment (spyder, pythonwin, jupyterlab, jupyter notebook) at various times.  Notebooks can run within Pro as well as outside of it (minus the map stuff).  So in short, there is little point in cloning the full base environment unless you plan to do mapping in both... arcpy, can now be installed in any environment, you just have to have a license for Pro on your local machine.  Don't bother trying to install arcpy with a python version > 3.7 though


... sort of retired...

View solution in original post

7 Replies
jcarlson
MVP Esteemed Contributor

As far as I know, Pro clones the default env so that you don't accidentally break the things Pro needs to function properly.

Are you just using the Python that came with Pro (Program Files/ArcGIS/Pro/bin/Python), or do you have it installed elsewhere?

In my opinion, if you'd really like to get into conda and different python envs, you should look into something like Anaconda. It makes it easier to set up different python envs that are separate from the Pro installation.

- Josh Carlson
Kendall County GIS
NathanHeickLACSD
Occasional Contributor III

I am just using the Python installation that came with ArcGIS Pro.  I read that you shouldn't use Anaconda and ArcGIS Pro on the same machine, so I accepted just working with the conda that came with ArcGIS Pro.

0 Kudos
jcarlson
MVP Esteemed Contributor

To each their own, I suppose. I've never had any trouble with it.

- Josh Carlson
Kendall County GIS
0 Kudos
NathanHeickLACSD
Occasional Contributor III

I think it was in an Esri blog or in the documentation, so I just accepted that.  That's not to say it can't be done.

DanPatterson
MVP Esteemed Contributor

There is little point in cloning the default arcgispro-py3 environment unless you plan to do mappy things in that environment.  A specific creation and installation of your desired packages to work outside of Pro is safe.  If there are packages that I want to use in the arcgispro-py3 environment, I install them there... if there are issues, they are easily walked back without issue (via conda install revision).  If you are doing the deep learning stuff, only use their frameworks ( Esri/deep-learning-frameworks: Installation support for Deep Learning Frameworks for the ArcGIS Syst... ).  I have installed several python IDEs in the base environment (spyder, pythonwin, jupyterlab, jupyter notebook) at various times.  Notebooks can run within Pro as well as outside of it (minus the map stuff).  So in short, there is little point in cloning the full base environment unless you plan to do mapping in both... arcpy, can now be installed in any environment, you just have to have a license for Pro on your local machine.  Don't bother trying to install arcpy with a python version > 3.7 though


... sort of retired...
NathanHeickLACSD
Occasional Contributor III

Yes, I am just trying to install pywin32 so that I can access adodbapi so I can run SQL statements against SQL Compact Edition databases (.sdf).  I don't need any map functionality, just the standard libraries and pywin32.  Okay, so ArcGIS Pro is probably looking for certain packages and versions and says the environment is broken if it doesn't find them.  That's fine.  It works just fine outside of ArcGIS Pro thus far.

0 Kudos
ThierryLegrain
New Contributor

In ArcGIS Pro 3.0.3 > Project > (Pro backstage) Package Manager, it states 'Cannot modify the default Python Environment (arcgispro-py3). Clone then activate a new environment first.'

If using ArcGIS Pro > Project > Package Manager > Environment Manager to clone the Default arcgispro-py3 environment, make sure that ArcGIS Pro is Run as Administrator. It needs permissions to write to /Program Files/. If not, cloning will fail.

0 Kudos