Created
February 10, 2015 03:09
-
-
Save bcchenbc/5bc6a46f679346e5cddd to your computer and use it in GitHub Desktop.
simple process to have a working pip without root privilege
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
# Adopted and edited from the solution by Evgeny at askbot.org | |
# http://askbot.org/en/question/2492/how-to-install-python-easy_install-python-distutils-in-root-or-non-root-account/ | |
# and instruction provided by authors of setuptools. | |
# https://pypi.python.org/pypi/setuptools | |
# | |
# Please be noticed that the virtual environment directory was set to ~/.pyvenv | |
# you might want to change it. | |
# I use only python3, no suffix was added to the directory. | |
# If you need to use both 2 & 3, it would be better to create 2 virtual environment directories. | |
## | |
# initiate a virtual environment | |
pyvenv-3.3 ~/.pyvenv | |
# add settings to .bashrc | |
PYTHONPATH=~.pyvenv/lib/python3.3/site-packages | |
export PYTHONPATH | |
# get and install setuptools, for a copy of easy_install | |
wget https://bootstrap.pypa.io/ez_setup.py -O - | python3 - --user | |
# get and install pip | |
wget https://bootstrap.pypa.io/get-pip.py -O - | python3 - --user | |
# give direction to the pip: | |
# you might want to add these lines to .bashrc | |
PATH=~/.local/bin/:$PATH | |
export PATH | |
# or, to add an alias, just save some keystroke for 'install' | |
alias pipu='~/.local/bin/pip3 install --user' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment