Standard python distutils provides a '--user' option which lets me install a package as a limited user, like this:
python setup.py install --user
Is there an equivalent for easy_install and pip?
For pip
, see User Installs for details, but basically, it's just what you'd expect:
pip install --user Foo
It's a bit trickier for easy_install
. As Ned Deily points out, if you can rely on distribute
rather than setuptools
, and 0.6.11 or later, you can just use --user
the same as pip
. But if you need to work with setuptools
, or older distribute
… see Custom Installation Locations for details (and note that it explains how to create and set up user site packages, not just how to install there, because it needs to be able to work with Python 2.5 and earlier, which didn't do this by default). But hopefully, you're only using easy_install
for the handful of packages that aren't pip
-able, so that isn't a big deal.
However, it's at least worth considering whether virtualenv
is a better fit for whatever you're trying to accomplish than a user site directory. pip
and virtualenv
work together very nicely, as the docs explain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With