#lang en <> = Description = [[https://github.com/pypa/virtualenv|Virtualenv]] is a tool for creating isolated virtual python environments. It is recommended to install PyPI packages within virtual environments, instead of system wide, to prevent version collisions when developing and running python projects. Virtualenv creates for each new environment a directory containing its own Python, pip, and wheel instances. It also contains any installed packages. These environment directories are not meant to be put inside of a project, nor should the project be created within the environment directory. Instead it is advisable to choose a dedicated location to put all your virtual environments, separate from your source code. = Snippets = === Creating a virtualenv === {{{#!highlight bash $ virtualenv enviroment_name # or $ virtualenv path/enviroment_name }}} === Activating a virtualenv === {{{#!highlight bash $ source virtualenv/bin/activate }}} === Deactivating a virtualenv === {{{#!highlight bash $ deactivate }}} === Exporting (virtualenv) packages === {{{#!highlight bash $ pip freeze > requirements.txt }}} === Importing (virtualenv) packages === {{{#!highlight bash $ pip install -r requirements.txt }}}