I’m trying to write some code that uses Numpy. However, I can’t import it:
JavaScript
x
8
1
Python 2.6.2 (r262, May 15 2009, 10:22:27)
2
[GCC 3.4.2] on linux2
3
Type "help", "copyright", "credits" or "license" for more information.
4
>>> import numpy
5
Traceback (most recent call last):
6
File "<stdin>", line 1, in <module>
7
ImportError: No module named numpy
8
I tried the suggestions in this question:
JavaScript
1
4
1
>>> import sys
2
>>> print sys.path
3
['', '/usr/intel/pkgs/python/2.6.2/lib/python26.zip', '/usr/intel/pkgs/python/2.6.2/lib/python2.6', '/usr/intel/pkgs/python/2.6.2/lib/python2.6/plat-linux2', '/usr/intel/pkgs/python/2.6.2/lib/python2.6/lib-tk', '/usr/intel/pkgs/python/2.6.2/lib/python2.6/lib-old', '/usr/intel/pkgs/python/2.6.2/lib/python2.6/lib-dynload', '/usr/intel/pkgs/python/2.6.2/lib/python2.6/site-packages']
4
and I searched for files named numpy
in that path:
JavaScript
1
2
1
$ find /usr/intel/pkgs/python/2.6.2/bin/python -iname numpy*
2
But nothing came up.
So…
- Are there any other places in which Python modules are commonly installed?
- How can I install numpy locally in my account, if it turns out that it isn’t installed in the central areas?
Advertisement
Answer
Have you installed it?
On debian/ubuntu:
JavaScript
1
2
1
aptitude install python-numpy
2
On windows:
http://sourceforge.net/projects/numpy/files/NumPy/
On other systems:
http://sourceforge.net/projects/numpy/files/NumPy/
JavaScript
1
4
1
$ tar xfz numpy-n.m.tar.gz
2
$ cd numpy-n.m
3
$ python setup.py install
4