Setting up a virtual environments with conda is very easy, and is recommended even for small projects. Virtual environments are very handy.
Setting up a virtual environment with conda
Getting ready
This recipe assumes that you have a working installation of Anaconda. If you don't, follow the recipe for installing Anaconda on your operating system presented previously in this chapter.
How to do it...
One of the features of conda, the standard package manager used with Anaconda, offers the easy creation and management of virtual environments. We will show you three recipes presenting the typical uses of conda virtual environments.
Before diving into the examples, enter the following statement in the command line:
conda info
This will print information about the current Anaconda installation. To obtain a list of the existing conda environments, enter the following:
conda info --envs
When I run this, I get the following output:
# conda environments:
#
root * /Users/luizmartins/anaconda
Right now, there is only the root environment, since this is a fresh Anaconda installation.