Skip to content

Virtual Environments

Hagen_Fritz edited this page Feb 10, 2021 · 1 revision

Virtual environments help you keep track of the packages you are using for your projects. Using these types of environments helps in the long run when you start to package your own projects into something others can use by easily.

What are virtual environments and why do we want to use them?

Virtual Environment Options

Using Conda

You can find more information here

Useful Commands

conda create --name <env_name> - Create blank environment with a given name
conda create -n <env_name> python=3.9 - Create environment with specific python version
conda env create -f environment.yml - Import environment from dependency file

conda remove --name myenv --all - Remove an environment

conda env export --from-history > environment.yml - Export environment
conda env export --from-history | findstr -v "prefix" > environment.yml - Export environment & remove prefix (findstr=windows, grep=linux)

conda clean --all - Cleans package cache
conda update --all - Updates all packages

  • Note: <> are used as placeholders

Using VirtualEnv

Clone this wiki locally