Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Original location "python" is installed (OS X pre-packaged Python 2)
- $ which python
- /usr/bin/python
- ## Install python3 from homebrew
- $ brew install python
- # New location where "python" is installed (brew version of Python 3)
- $ which python
- /usr/local/bin/python
- # Associated "pip" command (auto-installed by homebrew)
- $ pip
- ## Install python2 from homebrew
- $ brew install python2
- # Add homebrew python2 to the path
- $ echo 'export PATH="/usr/local/opt/python@2/bin:$PATH"' >> ~/.bash_profile
- # Associated "pip" command (auto-installed by homebrew)
- $ pip2
- ## Install virtualenvwrapper
- $ pip install virtualenvwrapper
- # Add the virtualenv commands to the path
- $ echo 'source virtualenvwrapper.sh' >> ~/.bash_profile
- # Create a virtual environment
- $ mkvirtualenv [-p /usr/local/bin/<pyversion>] <envname>
- # List all virtual environments
- $ lsvirtualenv
- # Work on a particular environment
- $ workon <envname>
- # Exit an environment
- $ deactivate
- # Remove an environment
- $ rmvirtualenv <envname>
- # Turn on site packages while inside environment
- $ toggleglobalsitepackages
Add Comment
Please, Sign In to add comment