Install modules with no root privilegies

Scott David Daniels Scott.Daniels at Acm.Org
Mon Nov 24 14:10:29 EST 2008


Alfons Nonell-Canals wrote:
> Hello,
> Install python modules in a linux computer is really easy, it is because
> the module is a package of the distribution or because the python
> installation is really easy. But, in both situations, you need root
> privilegies.
> 
> I would like to know how to install modules only for one user, with no
> root privilegies. Do you know if it is possible and easy. I would like
> to add that i need some modules only for my user and incly for one
> progam.
> 
> Thanks in advance!
> 
> Alfons.

As I just replied to another user (thinking I was responding to this
post), as of Python 2.6 / 3.0, if Python is not restricted to system
directories for security reasons (if sys.flags.no_user_site is non-0),
you may make a directory in your home directory to be searched.  See
     http://docs.python.org/library/site.html
for details on USER_SITE and USER_BASE.

That provides a searched location without having to cook up a custom
PYTHONPATH.

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list