1

I am trying to debug my Python program so I apt-get install python3.6-dbg. But when I run python3.6-dbg and I try to do import numpy I get:

>>> import numpy
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/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 "/usr/local/lib/python3.6/dist-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/usr/local/lib/python3.6/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python3.6/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/local/lib/python3.6/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/local/lib/python3.6/dist-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: cannot import name 'multiarray'

If I do that with regular python3.6 it works. numpy was installed through pip3 system-wide before I installed python3.6-dbg.

Mitar
  • 1,892
  • Not really. As noted in my question, I already have numpy installed. – Mitar Jul 19 '19 at 22:48
  • qed. Numpy was installed but it wasn't getting imported anyway. Why wasn't numpy getting imported? Because you didn't install the package maintainer's version, instead you installed it with pip. – karel Jul 19 '19 at 23:27
  • Installing with pip system-wise should also work. – Mitar Jul 20 '19 at 03:40

0 Answers0