What is the simplest way to do a user-local install of a python package?
I don't want to deal with virtualenv for a local Python installation, I just want to install a few packages locally without dealing with the
PYTHONPATHenvironment variable, how do I do that?
You say "deal with" as if virtualenv was a hassle. I've found the exact opposite to be true. (Perhaps you want `--system-site-packages`?)
Python (as of 2.6 and 3.0) now searches in the ~/.local directory for local installs, which do not require administrative privileges to install, so you just need to point your installer to that directory.
If you have already downloaded the package
fooand would like to install it manually, type:
cd path/to/foo python setup.py install --user
If you are using easy_install and would like the package downloaded and installed:
easy_install --prefix=$HOME/.local/ foo
Update by RafiK
pip install --user foo
The following answer is provided for historical purposes: It's a little more work if you are using pip to download and install:
pip install --install-option="--prefix=$HOME/.local" foo