Conda: Creating a virtual environment

I am not sure what causes the problem in your case, but code below works for me without any issues (OS X, the same version of Conda as yours).

Creation of the environment

conda create -n test_env python=3.6.3 anaconda

Some explanation of the documentation of conda create is not clear:

  • -n test_env sets name of the environment to test_env

  • python=3.6.3 anaconda says that you want to use python in version 3.6.3 in this environment (exactly the one you have, and you can use a different one if you need it) and package anaconda. You can put all the things you need there, separated with spaces, e.g., sqlite matplotlib requests and specify their versions the same way as for python.

Activation

conda activate test_env

Deactivation

conda deactivate

Getting rid of it

conda remove -n test_env --all

Leave a Comment