Guest User

Untitled

a guest
Mar 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. # Original location "python" is installed (OS X pre-packaged Python 2)
  2. $ which python
  3. /usr/bin/python
  4.  
  5. ## Install python3 from homebrew
  6. $ brew install python
  7. # New location where "python" is installed (brew version of Python 3)
  8. $ which python
  9. /usr/local/bin/python
  10. # Associated "pip" command (auto-installed by homebrew)
  11. $ pip
  12.  
  13. ## Install python2 from homebrew
  14. $ brew install python2
  15. # Add homebrew python2 to the path
  16. $ echo 'export PATH="/usr/local/opt/python@2/bin:$PATH"' >> ~/.bash_profile
  17. # Associated "pip" command (auto-installed by homebrew)
  18. $ pip2
  19.  
  20. ## Install virtualenvwrapper
  21. $ pip install virtualenvwrapper
  22. # Add the virtualenv commands to the path
  23. $ echo 'source virtualenvwrapper.sh' >> ~/.bash_profile
  24. # Create a virtual environment
  25. $ mkvirtualenv [-p /usr/local/bin/<pyversion>] <envname>
  26. # List all virtual environments
  27. $ lsvirtualenv
  28. # Work on a particular environment
  29. $ workon <envname>
  30. # Exit an environment
  31. $ deactivate
  32. # Remove an environment
  33. $ rmvirtualenv <envname>
  34. # Turn on site packages while inside environment
  35. $ toggleglobalsitepackages
Add Comment
Please, Sign In to add comment