Create cloned conda environment as user

7440
18
Jump to solution
06-14-2017 12:55 PM
curtvprice
MVP Esteemed Contributor

I am not allowed admin access, but I really want to be able to use pro's Conda environment. Currently my only option is to run another Conda install, but in theory, can't I clone the Pro environment to a folder have access to?

Conda suggests this:

Error: Missing write permissions in: C:\ArcGIS\Pro\bin\Python
#
# You don't appear to have the necessary permissions to update packages
# into the install area 'C:\ArcGIS\Pro\bin\Python'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_arcgispro-py3 --clone=C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3

but if I try it I get an error message:

PermissionError: [WinError 5] Access is denied: 'C:\\ArcGIS\\Pro\\bin\\Python\\nvs\\my_arcgispro-py3'

Is this possible? 

Tags (1)
0 Kudos
18 Replies
TobiasLitherland
New Contributor III

Ok, great! That worked.

Thank you very much, Clinton Dow. You have been ever so helpful.

GIS_Spellblade
Occasional Contributor

Has the creation of new environments been address yet in Pro?

ClintonDow1
Occasional Contributor II

Yes, new environments will now go to the user's AppData/Esri/conda directory which should allow them to interact with it and not experience permission issues. 

curtvprice
MVP Esteemed Contributor

Is this the case for per-user installs of ArcGIS Pro? Or admin installs too?

0 Kudos
PhilLarkin1
Occasional Contributor III

Any update? It doesn't appear supported in 2.2

0 Kudos
ClintonDow1
Occasional Contributor II

You should now be able to clone environments in 2.2 via the Manage Environments dialog by selecting an environment and clicking the clone button to the right hand side. 

0 Kudos
PhilLarkin1
Occasional Contributor III

Thanks for your reply.

Is it possible to clone the acrgis pro environment outside of the Pro root directory? For production level processes/analysis it is risky to rely on code in user folders. It is actually impossible most cases for me to run after hours processes and have access to my user folder. 

0 Kudos
HåkonDreyer
Esri Contributor

This is possible using conda from the Python Command Prompt. From there you may clone environments to your chosen location.

conda create --clone arcgispro-py3 --prefix c:\mydir\myclone

note that if you put your environment outside the defined envs directories they will not be listed using

conda info --envs

But you may still activate the environment, and all conda functionality are available, but you must use full path to the environment. Set active:

activate c:\mydir\myclone

Or just reference the clone with a full path when running conda commands:

conda install --name c:\mydir\myclone flask

NB: At the moment you may hit the issue described here https://community.esri.com/thread/217048-arcgis-pro-220-and-python-package-manager?sr=inbox&ru=15937... but I guess there will be a fix out soon.

PhilLarkin1
Occasional Contributor III

Thanks for your help. I was able to clone an environment outside of the pro directory and import arcpy from python from that env.

I think I'll wait for Pro 2.2.1. While I can't recreate the bug at 2.2 I'd rather not risk it.