Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Outline

Python

Creating Virtual Environments

Official documentation at: https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-and-using-virtual-environments.

There are two common tools for creating Python virtual environments:

  • venv is available by default in Python 3.3 and later, and installs pip and setuptools into created virtual environments in Python 3.4 and later.
  • virtualenv needs to be installed separately, but supports Python 2.7+ and Python 3.3+, and pip, setuptools and wheel are always installed into created virtual environments by default (regardless of Python version).

venv

# to enable
export DIR=.venv
python3 -m venv "$DIR"
source "$DIR"/bin/activate
# to disable
deactivate

virtualenv

export DIR=.venv
python3 -m virtualenv "$DIR"
source "$DIR"/bin/activate

VS Code

Using Python environments in VS Code: https://code.visualstudio.com/docs/python/environments.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.