1

My question is similar to How to install python packages without root privileges?, but I'm wondering if I need to install all the dependencies locally, or when I install a new package can tell the installer to use the globally installed packages when available?

I am working on a remote computer (unix machine) in which i don't have sudo/root priveledges. The remote already has Python and scientific libraries like Numpy and Scipy. But I've been having trouble installing a new python package.

This is a problem when i run

python setup.py install

because I don't have access to the lib folder. I know that I can install them locally using the command

python setup.py --user

but this creates another problem. It will install the package to /.local in my home directory but when the package has dependencies that are already globally installed in the root folders (things already installed globally, like in my case, numpy and scipy) it doesn't notice them and proceeds to install a new copy of them in the /.local directly.

How can I install a new package locally, but tell setup.py to look for dependent libraries and packages in the system root's lib folder?

4

1 回答 1

4

virtualenv is for you

virtualenv --system-site-packages

this will allow you using the global python package.

your own project will not need to install numpy or scipy

于 2013-02-27T05:42:14.953 回答