I have a conda environment named old_name
, how can I change its name to new_name
without breaking references?
Renames an existing environment. This command renames a conda environment via its name (-n/--name) or its prefix (-p/--prefix). The base environment and the currently-active environment cannot be renamed.
conda environments can get pretty big, so if you're running low on hard disk space and have another drive mounted, you can easily move your environment to a directory on the other drive and create a symbolic link to the new location.
You can't.
One workaround is to create clone a new environment and then remove the original one.
First, remember to deactivate your current environment. You can do this with the commands:
deactivate
on Windows orsource deactivate
on macOS/Linux.Then:
conda create --name new_name --clone old_name conda remove --name old_name --all # or its alias: `conda env remove --name old_name`
Notice there are several drawbacks of this method:
--offline
flag to disable it)There is an open issue requesting this feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With