Select to view content in your preferred language

Can I reset conda to installation state?

14678
17
06-24-2020 03:10 PM
EvanThoms
Frequent Contributor

With a new install of Pro 2.5, I have, between trying to manage environments at the command line and through the Package Manager, kludged up my conda. When I open the Package Manager now, the Project Environment window is blank and when I try to activate arcgispro-py3 (the only environment I have remaining at this point), the progress bar at the bottom of the dialog just scrolls and scrolls and the message remains 'Restart ArcGIS Pro for your environment changes to take place'. Of course, closing everything, apparently mid-process, and restarting does nothing.

Another thing that happens is that after a computer restart %localappdata%\ESRI\conda\envs\proenv.txt has the path to an environment I have removed and when I open the Python Command Prompt, conda is not available as a program. When I manually change that to arcgispro-py3, I can open the prompt and it's all good but that manual edit to proenv.txt does not stick. Something else writes it after a reboot. What process writes that file and where does it remember the environment?

Barring that, because these are all changes that I made as a non-admin user, is there something I can do to just wipe the slate and get me back to the original state of the conda installation?

0 Kudos
17 Replies
DanPatterson
MVP Esteemed Contributor

then don't mess with proenv.txt and

>activate arcgispro-py3

because you are in the clone now.

At least get back to Pro not croaking.

Either use the package manager or conda. 

I don't mix. (in fact I don't clone... but that is another story... look up my twin's posts

/blogs/dan_patterson/2020/02/09/clone-arcgis-pro-25  I think even Joe Borgione‌ can vouch for him  )


... sort of retired...
EvanThoms
Frequent Contributor

Dan, I appreciate the help. I think I will have to call in support.

I can activate the default environment from the command line, and be in that directory, but I still cannot get Pro there. It simply will not forget that myclone environment and I can't get it to switch to anything else. 

As a regular user, this is annoying because you can, after all, install and fiddle with Anaconda without admin rights and it seems like any caching that Pro might be doing to remember the last environment it was connected to should be in the user profile, which could be simply deleted. Oh well. This give me more reason to go to 2.5.1

0 Kudos
JoeBorgione
MVP Emeritus

This has been an intresting discussion; I've never even looked at the proenv.txt file.  For ArcGIS Pro, I've only created clones using Pro.  In fact just the other day something goofed in the clone I I use in Pro so I deleted it and recloned. I never have undertood the reasoning that locks down package adding through Pro to the default env when you can just add a package there with conda. A lot of it is a mystery to me...

That should just about do it....
0 Kudos
EvanThoms
Frequent Contributor

For crying out loud...it's very similar to the numpy problem that others have been reporting since v 2.2

Problem: Unable to create environments or install packages after upgrading to ArcGIS Pro 2.2 

(I couldn't follow the solution there because there were no other folders in \pkgs other than cache, even if I had permissions to delete them)

I finally learned about and looked at %localappdata%\ESRI\conda\conda_debug.log:

DEBUG:__main__:conda.cli.main called with ('C:\\ArcGIS\\Pro\\bin\\Python\\Scripts\\conda.exe', 'proswap', '-p', 'C:\\ArcGIS\\Pro\\bin\\Python\\envs\\myclone', '--json')
Setting environment CONDA_ROOT to C:\ArcGIS\Pro\bin\Python
Setting environment CONDA_PREFIX to C:\Users\ethoms\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone
Setting environment CONDARC to C:\ArcGIS\Pro\bin\Python\.condarc
proswap: Writing C:\Users\ethoms\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone as C:\Users\ethoms\AppData\Local\ESRI\conda\envs\proenv.txt
proswap: by prefix environment
proswap: The environment C:\ArcGIS\Pro\bin\Python\envs\myclone doesn't contain NumPy, which is required for ArcGIS Pro.‍‍‍‍‍‍‍

Listing the packages in the environments I see that all environments have numpy-base, but only when selecting arcgispro-py3 in the PM does this get interpreted, apparently, as numpy. For all others, an entry like above is generated. It's beyond my time and energy to investigate why. My workaround is to install numpy from the conda CLI. After doing that I can switch to a cloned environment in the PM and everything looks good. Yes, it means that the environment has numpy and numpy-base with the exact same version number, but I don't understand how these differ.

0 Kudos
DanPatterson
MVP Esteemed Contributor

I suspect the clone was not good.  ArcGIS Pro depends on numpy.  If the clone didn't have numpy-base, then the clone wasn't any good, hence your problems.

Mixing conda and package manager if you don't have full admin rights isn't recommended, one of the reasons that we disallowed cloning in our teaching labs, and we installed what we need in the base installation... no clones.  Clones were intended to make it so if things went bad,  you would have a fallback.  The fall back is a complete uninstall and reinstall from the downloaded msi.


... sort of retired...
0 Kudos
JoeBorgione
MVP Emeritus

The fall back is a complete uninstall and reinstall from the downloaded msi.

Like I was sayin'....   

That should just about do it....
0 Kudos
DanPatterson
MVP Esteemed Contributor

plus all the other stuff I mentioned after that Joe   (aka users folders, conda folder, etc etc)


... sort of retired...
0 Kudos
EvanThoms
Frequent Contributor

Yeah, lesson learned. I hadn't worked with environments through Pro before; I just knew you could manage them at the prompt, so that's where I went first. I didn't even know about the Package Manager until I got this version.

0 Kudos