Select to view content in your preferred language

Cloned Python environment and modified with Conda - crashes Pro!

480
8
Jump to solution
3 weeks ago
Vidar
by
Frequent Contributor

Hi,

I have created a cloned copy of the default python environment. 

For convenience, I put the Conda command on the PATH system variable by adding "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts". 

I used the Conda Forge command from a command prompt (running as Administrator, might not be necessary, but why not) to install pygplates: 

conda install conda-forge::pygplates 

 When you try and access Package Manager ArcGIS Pro crashes. Not sure how to get out of this mess or even fix my environment - it's a bit annoying that Pro just crashes out just like this - looks like I'm looking at a re-install and all the messing about that involves.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Vidar
by
Frequent Contributor

Yeh - I tried that - still broken. However I have now deleted every last remnant of Pro and uninstalled everything and cleaned out the Registry - that seems to have done the trick - but what a PITA!!!!

 

Thanks for your help though.

View solution in original post

0 Kudos
8 Replies
DanPatterson
MVP Esteemed Contributor

Was there anything else that rolled down the screen during the install?

I would be surprised if the conda-forge channel didn't want to updata a bunch of other packages.

Something may have been updated/installed that Pro didn't like (specifically arcgis, arcgisscripting and their dependencies)


... sort of retired...
0 Kudos
Vidar
by
Frequent Contributor

I can't remember exactly Dan - it said something like failed to install, freezing something and then took a few hours and then seemed to successfully install from conda forge - but it's well and truly screwed things up - and I'm surprised at that because I did all this in a cloned environment, not the native ESRI one.

0 Kudos
DanPatterson
MVP Esteemed Contributor

When you clone the arcgispro-py3  environment, it still has all the restrictions as its original because arcpy and its dependencies are also installed.  The dependencies and what it will allow to be installed are "pinned" (there are 2 "pinned" files... you can use windows explorer to find them in the Pro installation path... which you can see what exactly you must have installed.  At one time, 

conda install __some_package__ --no-pin

allowed you to quasi-override the pinned packages.  This didn't mean that your clone would work perfectly but it would override stuff.  Now the list of things that can cause issues grows.  For example, there is a huge break with NumPy and its relatives.  Currently NumPy 1.26 is installed with Pro 3.5.  The current version is 2.2.x and it introduced breaking changes and it has a trickle down effect which won't be addressed until arcpy/arcgisscripting/and others address the changes.  So... if there is a package that can't be installed in a clone or even the base arcgispro-py3 environment, it is best to split your work into... requires arcpy... doesn't require arcpy...  This necessitates "creating" an environment and installing what your want into it, but stick with the default (aka main) conda channel even if it is a little bit out of date since conda-forge doesn't guarantee everything will work together.  Maybe your pygplates would behave if you had installed it in your clone using

conda install -c defaults pygplates

but you would have had the latest and greatest pygplates package but one that might, just might, behave with all the other packages in the clone.

Good luck


... sort of retired...
Vidar
by
Frequent Contributor

Thanks for the deep dive on this Dan - always interesting to know the finer details about how all these environments are managed. Cheers

0 Kudos
Luke_Pinner
MVP Regular Contributor

I've broken cloned environments before mixing conda-forge and esri channels and avoid it now.  If you want to install stuff from conda-forge, create a fresh (non esri) env with `conda create -c conda-forge <packages>`.  

To get back to an unbroken env, in a terminal run `proswap arcgispro-py3`

0 Kudos
Vidar
by
Frequent Contributor

Unfortunately the swap command didn't change anything and it still doesn't like it's environment - even though this is now the second time I have installed it afresh.

0 Kudos
Luke_Pinner
MVP Regular Contributor

Reinstalling won't help. Try deleting the environment.

conda delete -n your_cloned_env

  Or in Windows Explorer, delete C:\Users\YOU\AppData\Local\ESRI\conda\envs\your_cloned_env Note AppData is a hidden folder)

0 Kudos
Vidar
by
Frequent Contributor

Yeh - I tried that - still broken. However I have now deleted every last remnant of Pro and uninstalled everything and cleaned out the Registry - that seems to have done the trick - but what a PITA!!!!

 

Thanks for your help though.

0 Kudos