Virtual Environments

EDS 220: Working with Environmental Data


What are environments?


A way to keep the packages and Python versions you use for different projects organized.

Why use them?

  • To not interfere with your computer’s pre-installed Python.

  • Packages usually depend on other packages to work properly, this is called a package dependency. Dependencies across different packages need to be carefully managed and may potentially be different across projects.

  • Reproducibility! Share your code and where ran it with others

Conda environments


Conda is an environment and package management system:

  • It can both create and administer the environments and install compatible versions of software and their dependencies.

  • Environments created with conda are usually called conda environments.

  • Can manage packages for any programming language (not just Python).

What are conda channels?


Conda channels are the locations where packages are stored.

In a standard Anaconda installation, packages are downloaded and updated from the default channel. But there are others!

We can choose which conda channel to install a package from.

What about pip?


  • pip is a package management system for Python.

  • We can use it to install packages from the Python Package Index (PyPI). Only Python packages.

  • We can use pip inside a conda environment when a package is not available from a conda channel.