Select to view content in your preferred language

conda environment failing?

1564
1
Jump to solution
07-05-2022 10:57 AM
mmann1123
Occasional Contributor

Hey guys,

    I am teaching a class on python through arcpro. I understand that I am supposed to clone arc's environment through arcpro, but from a teaching perspective this is terrible since they wont understand how to use conda outside of arc.  

I had previously been able to create a new working environment using:

conda create -n spatial arcpy arcgis -c esri

But now when I activate and go to import arcpy, I get a zanny error and the suggestion to do the very thing I would like to avoid.

The version of the binaries in the active Python environment do
not match the version of the binaries in the ArcGIS application.

Active environment version : 3.0
arcgispro-py3 environment version : 2.9

To update the existing environment see the conda proup subcommand
> conda proup --help

To manually create a new environment for use with the current ArcGIS application:
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
3. Create a new environment by cloning arcgispro-py3, and activate it:
> conda create --clone arcgispro-py3 --name my-env --pinned
> activate my-env
4. Add back missing conda packages from your current environment:
> conda env update -n my-env -f env.yaml
5. (Optional) Add back missing packages from pip:
> pip install -r requirements.txt
6. (Optional) Make it the default for the ArcGIS application and the
"Python Command Prompt":
> proswap my-env

Traceback (most recent call last):
File "c:\Users\mmann\Dropbox\6308 v2\IGSUP-New\IGSUP_data\0_Running_scripts\Solution\BufferCorvallisSchools.py", line 1, in <module>
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 88, 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\mmann\Anaconda3\envs\spatial\lib\site-packages\arcgisscripting\__init__.py", line 115, in <module>
raise ImportError("version mis-match") from None
ImportError: version mis-match

 

Any ideas? Is the conda-feedstock broken? 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
mmann1123
Occasional Contributor

Resolved.  Seems like the new version of arcpy is only working with arcpro 3.0.0 and is not backwards compatable. After updating arcpro, the new install of arcpy worked. 

View solution in original post

0 Kudos
1 Reply
mmann1123
Occasional Contributor

Resolved.  Seems like the new version of arcpy is only working with arcpro 3.0.0 and is not backwards compatable. After updating arcpro, the new install of arcpy worked. 

0 Kudos