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