I have cloned the default python env that installs with ArcGIS Server using conda create in the python command window using:
conda create --clone arcgispro-py3 -p"C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\py3_envclone2"
I activated the cloned env and installed jenkspy
(py3_envclone2) C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\py3_envclone2>conda install -c conda-forge jenkspy
Fetching package metadata ...............
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\py3_envclone2:
#
jenkspy 0.2.0 py37hcc03f2d_1 conda-forge
I then spun up the python console using python.exe in command window and then tested imports of my modules without fail:
>>> import arcpy
>>> import jenkspy
>>> import json
>>> import arcgis
>>>
However, when I run from my script:
# need to call pyhton from the environment where ArcGIS allows third party library installs to access all the necessary modules in the script
import sys
sys.path.append(r'C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\py3_envclone2')
# import remaining modules
import arcpy, json, jenkspy, arcgis
I get this error:
Traceback (most recent call last): File
"C:\Desktop\MyScript.py", line 10, in <module>
import arcpy, json, jenkspy, arcgis
ImportError: No module named jenkspy
What am I doing wrong?
try
from the code that you present so that we can see the error message and line number that it is coming from. Also, the error seems to be coming from yourfrom arcgis import GIS
so to simplify the code that you present, I think you should use a singleimport arcgis
(and nothing else) in the code that you present.sys.path.append
from script and then activate your clone before running the script.C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\py3_envclone2\python.exe