Cloning conda environments



You can clone (duplicate, copy) environments, this is useful when you are experimenting with packages whereas everything else is working fine:

- Existing tensorflow_gpu
- Newly created tensorflow_cpu


$ conda create --name py37 --clone base

List your environments :
$ conda info --envs
# conda environments:
#
                         /Users/uki/.julia/conda/3
                         /Users/uki/.julia/packages/ORCA/uEiWT/deps
base                  *  /anaconda3
py2                      /anaconda3/envs/py2
py37                     /anaconda3/envs/py37

Change to the newly created one:

$ source activate py37
Register this environment with Jupyter Notebook


$ python3 -m ipykernel install --user --name py37 --display-name "Python 3.7 (py37)"


Installed kernelspec py37 in /Users/uki/Library/Jupyter/kernels/py37


$ cd /Users/uki/Library/Jupyter/kernels/py37
$ code kernel.json

{
"argv": [
"/anaconda3/bin/python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3.7 (py37)",
"language": "python"
}



No comments:

Post a Comment