i like this post (click again to cancel)
1
i dont like this post (click again to cancel) remove favorite mark from this question (click again to restore mark)

I want to install numpy and scipy on my Linux workstation, but I don't have administrative priviledges. What is the best way to install numpy/scipy without asking any administrator ?

flag offensive community wiki
add comment
2 Answers:
i like this answer (click again to cancel)
3
i dont like this answer (click again to cancel)

Unfortunately, Linux distributions rarely support install as non-root, so your only solution is almost always to install from sources. For python >= 2.6, the easiest solution is the --user option:

python setup.py install --user

This will install numpy in $HOME/.local, and python automatically looks there for packages. You're done.

For python < 2.6, you may recreate a local hierarchy in your home directory (/home/joe/local/bin for binaries, /home/joe/local/lib for libraries, etc...), and install numpy in this hierarchy:

python setup.py install --prefix=$HOME/local

In that case, you need to tell python to look in $HOME/local, though. This can be controled by the PYTHONPATH variable. If your shell is bash (the default shell on most linux distributions), add this line in your .bashrc:

export PYTHONPATH=$HOME/local/lib/python2.5/site-packages:$PYTHONPATH

(of course, adapt the python version if necessary). Then, numpy will be available in any newly created shell, i.e.:

python -c "import numpy; print numpy.__file__"

should work and print something like /home/joe/local/lib/python2.5/site-packages/numpy/init.pyc.

permanent link | flag offensive
asked 2009-10-19 00:59:34
cdavid's gravatar image
51
add comment
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

great tips ! invaluable, thanks !

permanent link | flag offensive
asked 2009-12-05 14:56:32
elambert's gravatar image
1
add comment
Your answer:
You are now not logged in but you can answer first and then login
toggle preview

Made with Django.