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