Numpy Import Issue - python

I'm trying to run some code that uses the numpy library, but with only the statement
>>>import numpy
i get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 137, in <module>
import add_newdocs
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from type_check import *
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 5, in <module>
import multiarray
ImportError: DLL load failed: %1 no es una aplicaci¾n Win32 vßlida.
I already done the numpy installation as follows:
pip install numpy
at the command line, and everithing was fine.
What's wrong?
I have 64 bits Windows 10 and python 2.7.13
Thanks!!

Related

Error importing scikit-image library in Python

I install Python 3.10.6 [MSC v.1932 32 bit (Intel)] on win32. Also install scikit-image in version'0.18.3'.
When I type "from skimage import io", the following error is displayed:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from skimage import io
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\skimage\io\__init__.py", line 11, in <module>
from ._io import *
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\skimage\io\_io.py", line 4, in <module>
from ..color.colorconv import rgb2gray, rgba2rgb
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\skimage\color\__init__.py", line 1, in <module>
from .colorconv import (convert_colorspace,
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\skimage\color\colorconv.py", line 56, in <module>
from scipy import linalg
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\scipy\linalg\__init__.py", line 198, in <module>
from ._misc import *
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\scipy\linalg\_misc.py", line 3, in <module>
from .blas import get_blas_funcs
File "C:\Users\admin\AppData\Local\Programs\Python\Python310-32\lib\site-packages\scipy\linalg\blas.py", line 213, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed while importing _fblas: The specified module could not be found.
What is the problem? Please guide me. Thanks.

ArcGIS 10.4.1 ImportError: cannot import name multiarray with numpy

I've installed ArcGIS 10.4.1, and with it the numpy 1.9.2 library. However, I get the following error when I try to run any scripts with numpy:
>>> import numpy
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python27\ArcGIS10.4\lib\site-packages\numpy\__init__.py", line
170, in <module>
from . import add_newdocs
File "C:\Python27\ArcGIS10.4\lib\site-packages\numpy\add_newdocs.py", line
13, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\ArcGIS10.4\lib\site-packages\numpy\lib\__init__.py",
line 8, in <module>
from .type_check import *
File "C:\Python27\ArcGIS10.4\lib\site-packages\numpy\lib\type_check.py",
line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\ArcGIS10.4\lib\site-packages\numpy\core\__init__.py",
line 6, in <module>
from . import multiarray
ImportError: cannot import name multiarray
I've tried uninstalling and re-installing ArcGIS, still with no luck.
Thanks in advance

numpy suddenly started failing to import

I have anaconda installed. Running python 2.7. I have uninstalled, reinstalled, and upgraded numpy to 1.11.0, uninstalled and reinstalled pandas, and I still get this traceback when I try to import numpy:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/core/__init__.py", line 58, in <module>
from numpy.testing.nosetester import _numpy_tester
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/__init__.py", line 12, in <module>
from . import decorators as dec
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/decorators.py", line 21, in <module>
from .utils import SkipTest
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
File "/Users/nicole/anaconda/lib/python2.7/tempfile.py", line 35, in <module>
from random import Random as _Random
File "random/__init__.py", line 99, in <module>
from .mtrand import *
File "numpy.pxd", line 92, in init mtrand (numpy/random/mtrand/mtrand.c:37726)
It was working fine last night, which is really frustrating. Thank you for any insight.

Numpy not found in python and found in ipython

I installed numpy using pip. when I run ipython, numpy is imported successfully but when I run python and import numpy I get
ImportError: No module named numpy
I tried to set $PYTHONPATH to /usr/local/lib/python2.7/dist-packages
but then I get
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString
I am using
python 2.7.6
and Ipython 4.1.1

Numpy: ImportError: cannot import name TestCase

I installed numpy from
sudo apt-get install numpy
Then in python2.7 on importing numpy with
import numpy
I get this error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 4, in <module>
from type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 45, in <module>
from numpy.testing import Tester
File "/usr/local/lib/python2.7/dist-packages/numpy/testing/__init__.py", line 8, in <module>
from unittest import TestCase
ImportError: cannot import name TestCase
I then removed Numpy and Scipy. Then again installed from the github repo. But I still get the same error. Please help.
Thank You.
I suspect that you have a local file called unittest.py that is getting imported instead of the standard module.

Categories