Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

easy_install or pip as a limited user?

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?

like image 782
Giampaolo Rodolà Avatar asked Apr 09 '13 21:04

Giampaolo Rodolà


1 Answers

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.

like image 88
abarnert Avatar answered Sep 30 '22 18:09

abarnert