I’m used to installing and running my Ruby gems in user space with the help of
rbenv. I wasn’t aware of a similar setup for Python, until today.
This Gist by Matthew guides you through all the steps you need to take. It’s quite simple, really.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Uninstall sudo-requiring pip (only if pip is already installed) sudo pip uninstall pip # Download pip curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py # Install pip with the --user argument python ~/Downloads/get-pip.py --user # Add Python's bin folder in ~/Library to your PATH environment variable echo 'export PATH="$HOME/Library/Python/2.7/bin:$PATH"' >> ~/.bashrc # Reload your config source ~/.bashrc
Matthew mentions to remember to append
--user when installing modules:
1 $ pip install <package_name> --user