Hi All,
I recently updated from Pro 2.6 to Pro 2.7 and encountered an issue that I've had in the past when updating Pro. Specifically,
- I have a nice conda env set up (i.e. time went in to downloading lots of custom packages) and I use Spyder as my IDE.
- But after updating Pro, when I import arcpy in Spyder, I get this error message:
The version of the binaries in the active Python environment do
not match the version of the binaries of the ArcGIS Pro application.
Active environment version : 2.6
arcgispro-py3 environment version : 2.7
To create a new environment that is up to date with arcgispro-py3:
1. Generate a list of additional packages installed in your current environment,
with the conda command:
> conda env export > env.yaml
2. (Optional) If you have additional dependencies installed through pip,
find those with pip freeze:
> pip freeze > requirements.txt
2. Create a new environment by cloning arcgispro-py3, and activate it:
> conda create --clone arcgispro-py3 --name my-env --pinned
> activate my-env
3. Add back missing conda packages from your current environment:
> conda env update -n my-env -f env.yaml
4. (Optional) Add back missing packages from pip:
> pip install -r requirements.txt
5. (Optional) Make it the default for the ArcGIS Pro application and the
"Python Command Prompt":
> proswap my-env
Traceback (most recent call last):
File "<ipython-input-1-5467a3dc9fe3>", line 1, in <module>
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 74, in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
from ._base import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
File "C:\Users\dconly\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgisscripting\__init__.py", line 112, in <module>
raise ImportError("version mis-match") from None
ImportError: version mis-match
Referring to the excerpt above, I go through the first 3 steps (unfortunately step 2 is labeled twice but I do steps 1 and both of the 2s). But when I try to do the 4th step (run conda env update -n my-env -f env.yaml) I get this message below:
UnsatisfiableError: The following specifications were found to be in conflict:
- matplotlib-base 3.2.2 py36h64f37c6_0 -> python >=3.6,<3.7.0a0
- python 3.7.*
Use "conda info <package>" to see the dependencies for each package.
This is the part cannot get past. It seems like some of the packages from my old custom env (as indicated in the yaml) are not compatible with the new version of python in the new custom env.
My other alternative is to just manually re-add all of the packages that were in my old custom environment, but this is tedious (about a dozen packages to add and I need to remember which ones) and should not be as annoying for a process that apparently needs to happen semi-regularly (i.e., when ESRI pushes out an update to Pro that makes it no longer compatible with older versions of arcpy).
Has anyone else seen this? Or found a more efficient way of recreating a custom environment after Pro updates?