Create and activate an environment
conda create -n python2 python=2.7 anaconda
source activate python2
Deactivate environment
source deactivate python2
List environments
conda env list
Remove an environment
conda env remove --name python2
When using Spyder, Jupyter in Anaconda
Ensure you have at least Anaconda 4.1.o or higher
conda --version
If not update conda
conda update conda
Check if nb_conda_kernels is installed
conda list
If not install
conda install nb_conda_kernels
If you’re running Jupyter on Python 3, you can set up a Python 2 kernel like this:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
Alternatively, if you are using Python 2 and want a separate Python 3 environment please type the following
conda create -n py36 python=3.6 ipykernel
py36 is the name of the environment. You could literally name it anything you want. If you are using Python 3 and want a separate Python 2 environment, you could type the following.
conda create -n py27 python=2.7 ipykernel
Open new terminal.
Launch Jupyter and see the new environments listed.
Perhaps
?