ArcGIS Pro 2.2.0 and Python Package Manager

31339
112
Jump to solution
06-27-2018 11:00 AM
MitchHolley1
MVP Regular Contributor

I updated to Pro 2.2.0 today and noticed the default python environment is now read-only.  The previously downloaded packages I had were wiped out with the new update.  I need to get the package, spyder, back into my environment.  So, I cloned the arcgispro-py3 environment in order to make the install. 

Notice that the window says, "Restart ArcGIS Pro for your environment changes to take effect."

So, I clicked 'Exit'. 

After the program restarted, I no longer have a cloned environment to select.

Can someone please help?

1 Solution
112 Replies
DanPatterson_Retired
MVP Emeritus

My Spyder and everything else I had installed was in the update and is functioning.

And yes, the new environment is locked for some reason

Kory Kramer‌  can you flag someone to find out why … and cloning is failing miserably based on the number of related posts. 

James_Whitacre
Occasional Contributor

Yes, this is critical! Spyder is essential. Maybe it should be added to the default install?

Thanks Mitch Holley‌ for starting this thread.

George_Thompson
Esri Frequent Contributor

Kory Kramer‌ I have a case opened with support on this. I am able to duplicate the behavior.

--- George T.
DanPatterson_Retired
MVP Emeritus

Bizarre... maybe nothing of mine got 'toasted' was because I was on Beta 2.2.  Nothing got removed when I moved from 2.1 to beta 2.2 and everything is in it's place now... except for the fact that the package manager is locked.

I have been using Spyder etc without incident since moving from beta 2.2 to the upgrade 2.2 yesterday

HåkonDreyer
Esri Contributor

Seems something is fundamentally wrong with the Conda environment. Did a clean install of Pro and experience the reported behavior from inside Pro, and even a simple create fails from cmd.

Error message

MarcoBoeringa
MVP Regular Contributor

@Hakon Dreyer,

Please note that I already discovered one bug related to path names in the interface of the package manager of Pro 2.2, that may or may not be the root cause of this issue. I posted that with screenshots in this thread:

https://community.esri.com/thread/217056-error-with-toolboxes-in-arcgis-pro-22#comment-781502

Notice how Pro omits the "_" underscore in the path of the "backup" of the Conda environment that Pro 2.2 creates upon install. I could definitely see a wrangled path causing more issues...

GhislainPrince
Esri Contributor

@Hakon, i got by your problem by using `conda clean`.  We're finding that some machines upgraded from 2.1 require this step.

Also, your use of `conda create` will create an environment without modules such as numpy, matplotlib, and arcgis (to name a few) which parts of arcpy needs.  To create an environment that'll work with arcpy (and that you can use with ArcGIS Pro you should clone arcgispro-py3 like so

conda create --clone arcgispro-py3 --name %LocalAppData%\ESRI\conda\envs\my_env --verbose

Fixing the "CondaError: Cannot link a source that does not exist." error.

(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>conda create --name prodebug2 python=3.6
WARNING: A space was detected in your requested environment path
'C:\Program Files\ArcGIS\Pro\bin\Python\envs\prodebug2'
Spaces in paths can sometimes be problematic.

Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment C:\Program Files\ArcGIS\Pro\bin\Python\envs\prodebug2:

The following NEW packages will be INSTALLED:

    certifi:        2018.4.16-py36_0
    pip:            10.0.1-py36_0
    python:         3.6.6-hea74fb7_0
    setuptools:     39.2.0-py36_0
    vc:             14-h0510ff6_3
    vs2015_runtime: 14.0.25420-0       esri
    wheel:          0.31.1-py36_0
    wincertstore:   0.2-py36h7fe50ca_0

Proceed (/n)? y

ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'defaults::python-3.6.6-hea74fb7_0'.
CondaError: Cannot link a source that does not exist. C:\Program Files\ArcGIS\Pro\bin\Python\pkgs\python-3.6.6-hea74fb7_0\Lib\__pycache__\__future__.cpython-36.pyc
Attempting to roll back.


CondaError: Cannot link a source that does not exist. C:\Program Files\ArcGIS\Pro\bin\Python\pkgs\python-3.6.6-hea74fb7_0\Lib\__pycache__\__future__.cpython-36.pyc



(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>conda clean --all
Cache location: C:\Program Files\ArcGIS\Pro\bin\Python\pkgs
Will remove the following tarballs:

C:\Program Files\ArcGIS\Pro\bin\Python\pkgs
-------------------------------------------

--- SNIPPED OUT LONG LIST OF PACKAGES AND PROMPTS ---



(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>conda create --name prodebug3 python=3.6
WARNING: A space was detected in your requested environment path
'C:\Program Files\ArcGIS\Pro\bin\Python\envs\prodebug3'
Spaces in paths can sometimes be problematic.

Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment C:\Program Files\ArcGIS\Pro\bin\Python\envs\prodebug3:

The following NEW packages will be INSTALLED:

    certifi:        2018.4.16-py36_0
    pip:            10.0.1-py36_0
    python:         3.6.6-hea74fb7_0
    setuptools:     39.2.0-py36_0
    vc:             14-h0510ff6_3
    vs2015_runtime: 14.0.25420-0       esri
    wheel:          0.31.1-py36_0
    wincertstore:   0.2-py36h7fe50ca_0

Proceed (/n)? y

vs2015_runtime 100% |###############################| Time: 0:00:00   2.38 MB/s
vc-14-h0510ff6 100% |###############################| Time: 0:00:00   0.00  B/s
python-3.6.6-h 100% |###############################| Time: 0:00:02   9.62 MB/s
certifi-2018.4 100% |###############################| Time: 0:00:00   0.00  B/s
wincertstore-0 100% |###############################| Time: 0:00:00 881.16 kB/s
setuptools-39. 100% |###############################| Time: 0:00:00   4.67 MB/s
wheel-0.31.1-p 100% |###############################| Time: 0:00:00   5.26 MB/s
pip-10.0.1-py3 100% |###############################| Time: 0:00:00   6.07 MB/s
#
# To activate this environment, use:
# > activate prodebug3
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#


(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>activate prodebug3

(prodebug3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>
HåkonDreyer
Esri Contributor

Thank you Ghislain Prince,

I almost wrote your post on Monday when running conda clean --all (as admin) fixed the issue om my computer. Then I did a bit more testing and found that clean was no silver bullet.

Of the 6 installations I have tested, 5 had the problem. Clean only fixed one of those entirely. (Allow for cloning from inside Pro) Of the other four installations, cleaning allowed creating new environments on two, but still didn't allow cloning of the arcgispro-py3 environment.

A conda list --explicit on a troubled computer shows that the arcgispro-py3 environment references some packages more than one time with different versions.

# This file may be used to create an environment using:
# $ conda create --name  --file  
# platform: win-64 
@EXPLICIT 
https://conda.anaconda.org/esri/win-64/arcgis-1.4.1-py36h52c3b5e_1.tar.bz2
https://conda.anaconda.org/esri/win-64/arcgispro-2.2-0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/asn1crypto-0.24.0-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/atomicwrites-1.1.5-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/attrs-17.4.0-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/attrs-18.1.0-py36_0.tar.bz2
https://repo.anaconda.com/pkgs/main/win-64/backcall-0.1.0-py36_0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/bleach-2.1.3-py36_0.tar.bz2 
https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2018.03.07-0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/certifi-2018.1.18-py36_0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/certifi-2018.4.16-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/cffi-1.11.5-py36h945400d_0.tar.bz2 
...

In a vanilla install of Pro 2.2 none of these duplicates occurs. Before upgrade, the Pro 2.1.3 environment on this computer looked like:

# This file may be used to create an environment using: 
# $ conda create --name  --file  
# platform: win-64 
@EXPLICIT 
https://conda.anaconda.org/esri/win-64/arcgis-1.2.5-py36_1.tar.bz2 
https://conda.anaconda.org/esri/win-64/arcgispro-2.1-0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/asn1crypto-0.24.0-py36_0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/atomicwrites-1.1.5-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/attrs-18.1.0-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/backcall-0.1.0-py36_0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/bleach-2.1.3-py36_0.tar.bz2 
https://repo.continuum.io/pkgs/main/win-64/ca-certificates-2018.03.07-0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/certifi-2018.4.16-py36_0.tar.bz2
https://repo.continuum.io/pkgs/main/win-64/cffi-1.11.5-py36h945400d_0.tar.bz2 
...

As you can see the Pro2.2 comes with older versions of the packages, and some packages like ca-certificates have changed repo from continuum.io to anaconda.com. After cleaning creating of new environments on this computer works fine, but cloning of the arcgispro-py3 still gives:

ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'defaults::python-3.6.5-h0c2934d_0'. 
CondaError: Cannot link a source that does not exist. C:\Program Files\ArcGIS\Pro\bin\Python\pkgs\python-3.6.5-h0c2934d_0\Lib\__pycache__\__future__.cpython-36.pyc 
Attempting to roll back.  

CondaError: Cannot link a source that does not exist. C:\Program Files\ArcGIS\Pro\bin\Python\pkgs\python-3.6.5-h0c2934d_0\Lib\__pycache__\__future__.cpython-36.pyc

PS: I know I should use a clone if the environment are to be used inside Pro, but it is not necessary to clone it to test for the bug. As you know, before cleaning it pops up on plain creates as well

GhislainPrince
Esri Contributor

Hi Håkon,

 thanks for reply.  I noticed that late yesterday too.  We've been trying to figure out a way to make conda work with this situation, we don't have it yet.  We'll keep researching that.

In the meantime this works if you're willing: browse to C:\Program Files\ArcGIS\Pro\bin\Python\pkgs .  Do NOT delete the cache folder, and no need to delete the *.bz2, but delete the rest of the packages folders (asn1crypto-0.24.0-py36_0, attrs-18.1.0-py36_0, backcall-0.1.0-py36_0...)

then clone & pro's python backstage worked for me.

These folders will get created from the *.bz2 files next time you need them (ie. next time you clone).

If you delete the *.bz2 files it's no big deal they'll get downloaded again (they're 80MB total).

Richard_Stokes
New Contributor II

I have the same issue, any suggestions or workarounds would be appreciated.

I can clone the base pro environment or create a new one, and even though they're listed using conda env list, Pro refuses to recognise them.  The resulting folder structures look normal, and there isn't a competing Python install or program overriding the path.