Reputation: 365
I am trying to install scipy
and numpy
. Because I don't have root privileges, when I tried to install numpy
first, I typed python setup.py install --prefix=/data3/home
which worked. When I then tried to install scipy
it reported this error:
File "setup.py", line 230, in <module>
setup_package()
File "setup.py", line 218, in setup_package
from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core
How can I fix this issue?
Upvotes: 10
Views: 8488
Reputation: 26050
A more standard way around is to make a per-user install like described in PEP 370 :
pip install numpy --user
Or use a virtualenv.
Upvotes: 6
Reputation:
export PYTHONPATH="/data3/home/:$PYTHONPATH"
should solve your problem.
What this does is that it appends your custom path /data3/home
to the standard PYTHONPATH
variable; all Python scripts will first check /data3/home
for libraries (and hopefully find the one you need) before checking the system-wide directories (usually under /usr/lib/python*
).
Upvotes: 2