No Ubuntu 12.04 64-bit, eu instalei o python 2.7.3 e o numpy 1.6.2.
Quando tento importar numpy, recebo isso:
erelsgl@erel-biu:/host/Dropbox/ai/routes$ python
Python 2.7.3 (default, Nov 25 2012, 17:50:36)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
ImportError: No module named multiarray
Estranhamente, esse problema não ocorre no meu outro computador, que também roda o Ubuntu 12.04 de 64 bits.
UPDATE: removi a instalação manual do numpy:
$ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy
Em seguida, reinstale usando o apt:
$ sudo apt-get install python-numpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libblas3gf libgfortran3 liblapack3gf
Suggested packages:
python-numpy-doc python-numpy-dbg python-nose python-dev gfortran
The following NEW packages will be installed:
libblas3gf libgfortran3 liblapack3gf python-numpy
0 upgraded, 4 newly installed, 0 to remove and 115 not upgraded.
Need to get 6,918 kB of archives.
After this operation, 19.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://il.archive.ubuntu.com/ubuntu/ precise/main libgfortran3 amd64 4.6.3-1ubuntu5 [357 kB]
Get:2 http://il.archive.ubuntu.com/ubuntu/ precise/main libblas3gf amd64 1.2.20110419-2ubuntu1 [287 kB]
Get:3 http://il.archive.ubuntu.com/ubuntu/ precise/main liblapack3gf amd64 3.3.1-1 [4,424 kB]
Get:4 http://il.archive.ubuntu.com/ubuntu/ precise/main python-numpy amd64 1:1.6.1-6ubuntu1 [1,850 kB]
Fetched 6,918 kB in 0s (8,638 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libgfortran3.
(Reading database ... 80%
(Reading database ... 237799 files and directories currently installed.)
Unpacking libgfortran3 (from .../libgfortran3_4.6.3-1ubuntu5_amd64.deb) ...
Selecting previously unselected package libblas3gf.
Unpacking libblas3gf (from .../libblas3gf_1.2.20110419-2ubuntu1_amd64.deb) ...
Selecting previously unselected package liblapack3gf.
Unpacking liblapack3gf (from .../liblapack3gf_3.3.1-1_amd64.deb) ...
Selecting previously unselected package python-numpy.
Unpacking python-numpy (from .../python-numpy_1%3a1.6.1-6ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up libgfortran3 (4.6.3-1ubuntu5) ...
Setting up libblas3gf (1.2.20110419-2ubuntu1) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3gf to provide /usr/lib/libblas.so.3gf (libblas.so.3gf) in auto mode.
Setting up liblapack3gf (3.3.1-1) ...
update-alternatives: using /usr/lib/lapack/liblapack.so.3gf to provide /usr/lib/liblapack.so.3gf (liblapack.so.3gf) in auto mode.
Setting up python-numpy (1:1.6.1-6ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Em seguida, tente novamente, e agora, numpy não é reconhecido em todos!
$ python
Python 2.7.3 (default, Nov 25 2012, 17:50:36)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy