Python Forum

Full Version: not able to import numpy in pthon_d
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to import numpy libary using the python_d.exe but get import error. Please see below:
:\numpy>python_d
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:58:56) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
Traceback (most recent call last):
File "C:\numpy\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: cannot import name 'multiarray'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\numpy\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\numpy\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\numpy\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\numpy\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\numpy\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.

Original error was: cannot import name 'multiarray'


I tried to build a debug verion but also get error wen building numpy array from source:

:\numpy>python_d runtests.py --ipython
Building, see build.log...
... build in progress
Build OK
Enabling display of all warnings and pre-importing numpy as np
C:\Python\Python36\lib\site-packages\IPython\lib\pretty.py:91: DeprecationWarning: IPython.utils.signatures backport for Python 2 is deprecated in IPython 6, which only supports Python 3
from IPython.utils.signatures import signature
C:\Python\Python36\lib\site-packages\IPython\utils\module_paths.py:28: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "C:\numpy\build\testenv\Lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: Module use of python36.dll conflicts with this version of Python.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "runtests.py", line 466, in <module>
main(argv=sys.argv[1:])
File "runtests.py", line 188, in main
import numpy as np
File "C:\numpy\build\testenv\Lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\numpy\build\testenv\Lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\numpy\build\testenv\Lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\numpy\build\testenv\Lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\numpy\build\testenv\Lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.

Original error was: Module use of python36.dll conflicts with this version of Python.

Your advice is very much appreciated. Thanks in advance.