Estou tentando instalar numpy
em Python 2.7
em virtualenv
(no Cygwin).
No entanto, quando tento import numpy
, obtenho um ImportError
:
Administrator@Ron ~/python/virtualenv
$ virtualenv -p /usr/bin/python2.7.exe machine_learning
Running virtualenv with interpreter /usr/bin/python2.7.exe
New python executable in /home/Administrator/python/virtualenv/machine_learning/bin/python2.7
Also creating executable in /home/Administrator/python/virtualenv/machine_learning/bin/python
Installing setuptools, pip, wheel...done.
Administrator@Ron ~/python/virtualenv
$ source machine_learning/bin/activate
(machine_learning)
Administrator@Ron ~/python/virtualenv
$ pip2 install numpy
Collecting numpy
Installing collected packages: numpy
Successfully installed numpy-1.13.0
(machine_learning)
Administrator@Ron ~/python/virtualenv
$ python2 -c "import numpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/lib/__init__.py", line 19, in <module>
from .polynomial import *
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 20, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/home/Administrator/python/virtualenv/machine_learning/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 30, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: No such file or directory
(machine_learning)
Administrator@Ron ~/python/virtualenv
Alguma sugestão de como instalar o numpy no Python 2.7 em virtualenv?
Nota:
A versão Python3 do Cygwin é 3.6, e parece que o pypi numpy ainda não está pronto para o 3.6.
Editar 1:
Em resposta ao comentário do matzeri , desinstalei o numpy
do pip3 e do pip2 e instalei o numpy
para Python 3 e Python 2 do setup.exe do Cygwin.
A seguir estão os erros que recebo para numpy quando tento importá-lo depois:
$ python3 -c "import numpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python3.6/site-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python3.6/site-packages/numpy/lib/polynomial.py", line 20, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python3.6/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: No such file or directory
$ python2 -c "import numpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 20, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: No such file or directory