Skip to content

Instantly share code, notes, and snippets.

@lcfd
Forked from evansneath/Python3 Virtualenv Setup
Created July 20, 2016 06:49
Show Gist options
  • Save lcfd/545c58d4ee0fdbf80ac7e6a9a2a7755e to your computer and use it in GitHub Desktop.
Save lcfd/545c58d4ee0fdbf80ac7e6a9a2a7755e to your computer and use it in GitHub Desktop.
Setting up and using Python3 Virtualenv
To install virtualenv via pip
$ pip3 install virtualenv
Note that virtualenv installs to the python3 directory. For me it's:
$ /usr/local/share/python3/virtualenv
Create a virtualenvs directory to store all virtual environments
$ mkdir somewhere/virtualenvs
Make a new virtual environment with no packages
$ virtualenv somewhere/virtualenvs/<project-name> --no-site-packages
To use the virtual environment
$ cd somewhere/virtualenvs/<project-name>/bin
$ source activate
You are now using the virtual environment for <project-name>. To stop:
$ deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment