Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.83 KB | None | 0 0
  1. # This memo is done in order to help others who want to install Python 3 on MacOS
  2. # These commands have been tested to work on MacOS 10.13.1, so YMMV.
  3.  
  4. # Use this to install Homebrew:
  5. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  6.  
  7. # Since it's somewhat universally considered to be bad practice to use sudo for installing packages,
  8. # I've decided to document my way installing python3, virtualenv and virtualenvwrapper on brew-installed python3.
  9.  
  10. brew install python3
  11. pip3 install virtualenv virtualenvwrapper
  12.  
  13. # Next step is voluntary, but I like to use it in order not to install python packages system-wide, which would require sudo.
  14. # nano ~/Library/Application\ Support/pip/pip.conf
  15. [install]
  16. require-virtualenv = true
  17.  
  18. [uninstall]
  19. require-virtualenv = true
  20.  
  21. # Previous commands are undocumented but they prevent you from installing python3 packages system-wide (globally), which can
  22. # run you into problems later with permissions etc.
  23.  
  24. # Next, you need to add the following to your .bash-profile.
  25.  
  26. nano .bash-profile
  27.  
  28. # If you don't manually export VIRTUALENVWRAPPER appropriately for your version of python,
  29. # it will assume the system default where you don't have the virtualenvwrapper package installed. Add these lines to fix:
  30.  
  31. export WORKON_HOME=$HOME/.virtualenvs
  32. export VIRTUALENVWRAPPER_PYTHON=$(which python3.6)
  33. export PROJECT_HOME=$HOME/Devel
  34. source /usr/local/bin/virtualenvwrapper.sh
  35.  
  36. # An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default
  37. # for each new terminal window, calling .bash_profile instead of .bashrc.
  38. # -John Steiger, http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
  39.  
  40. # Finally and then you can use virtualenwrapper's commands found from its docs.
  41. source .bash-profile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement