Can the name be changed to an environment in conda?

2

Can the name be changed to an environment in conda? For example I have an environment called py34 and I would like to change the name to py3k, instead of having to create an environment again with this name.

    
asked by Javier Cárdenas 10.12.2015 в 02:19
source

1 answer

3

I used conda once and I never tried to do something like that, seeing documentation I do not see anything like editing the name of a virtual environment.

The closest thing could be cloning the virtual environment and then < a href="http://conda.pydata.org/docs/using/envs.html#remove-an-environment"> remove the old one:

$ conda create --name py3k --clone py34
$ conda remove --name py34 --all

There could be another option (not recommended) that involves modifying some things in the ~/.conda folder. First you would have to edit the file environments.txt that conda uses to take control of the URLs of the virtual environments:

$ cat ~/.conda/environments.txt 
/home/jdash/.conda/envs/py34

Modify it using nano or your favorite editor to:

/home/jdash/.conda/envs/py3k

Then it would only be rename the folder of your virtual environment:

$ ls -l ~/.conda/envs/
total 4
drwxrwxr-x 8 jdash jdash 4096 dic  9 21:29 py34
$ mv ~/.conda/envs/py34 ~/.conda/envs/py3k

Finally, activate your virtual environment:

$ source activate py3k
    
answered by 10.12.2015 / 03:40
source