Any way to change name of python environment in ArcGIS Pro 2.3?

1976
3
04-21-2019 01:14 AM
HN1
by
New Contributor II

From ArcGIS Pro 2.3, it seems that there is no functionality to edit name of python environment.

How can we change the name of python env?

A solution that possibly work is copying environment with new name from cond command like the link below.

python - How can I rename a conda environment? - Stack Overflow 

However, it is a bit cumbersome. Is there any other way to edit the environment name on Pro 2.3?

Tags (2)
0 Kudos
3 Replies
DanPatterson_Retired
MVP Esteemed Contributor

The recommended way of producing a duplicate clone of your environment is the way to go, especially if you follow the GitHub thread...

request: conda "rename" (or conda "move") for changing name of an environment · Issue #3097 · conda/... 

It is still an open/ignored issue.

The only downside is the duplicate space used  by the clone but you already have duplication by using cloning in the first place.  If you feel the need to use cloning at least you can test to make sure your 'renamed clone' functions as you see fit.  When you are satisified, that all is good simply remove the poorly named version

HN1
by
New Contributor II

Dan,

Thank you for replying always.

Until Pro 2.2, I think we could specify env name when we create new one or clone from another one.

It help me identify which env has specific package that can compete with other packages like TensoFlow vs PyTorch.

Based on your comment and other resources on the internet, at this time, the solution seems to be cloning renamed env and delete old one.

Again, thank you for your help, Dan.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

No problem. don't forget to clean your environments as well and to test things prior to installing 

(arcgispro-py3) C:\arc_pro\bin\Python\envs\arcgispro-py3>conda clean --all --dry-run

I will list the 'extra' baggage that will be removed.  Once you have examined the dry-run, then you can just >conda clean --all to remove things.

https://docs.conda.io/projects/conda/en/latest/_downloads/1f5ecf5a87b1c1a8aaf5a7ab8a7a0ff7/conda-che... 

and other similar are a good reminder.

And you can back up your environment if needed

conda env export --name ENVNAME > envname.yml

0 Kudos