Last active
November 20, 2015 09:26
-
-
Save washal/08c65a65a64a3427f2bd to your computer and use it in GitHub Desktop.
Use Virtual Environments in Python3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Ref: http://chrisstrelioff.ws/sandbox/2014/09/16/python_3_4_on_ubuntu_14_04_using_virtual_environments.html | |
| # Create a virtual environment directory to store all virtual environments | |
| $ mkdir somedir/venvs | |
| # Create virtual environment using python 3 | |
| mkvirtualenv <project_name> -p /usr/bin/python3 | |
| # It automatically brings you into the virtual env for that project | |
| (project_name)$ | |
| # To exit from the VE | |
| (project_name)$ deactive | |
| $ | |
| # Enter into the project virtual environment | |
| $ workon <project_name> | |
| (project_name)$ | |
| # NOTE: To ensure environment variable is set at login, you can add the below lines to .bashrc | |
| export WORKON_HOME='/rootdir/somedir/ve' | |
| source /usr/local/bin/virtualenvwrapper.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment