Numpy: Kein Modul namens 'numpy.core._multiarray_umath'

Erstellt am 16. Feb. 2019  ·  23Kommentare  ·  Quelle: numpy/numpy

Ich habe gerade TensorFlow, Keras in anaconda3 installiert.

C:\conda create --name neuralnets python=3.7
C:\activate neuralnets

(neuralnets) C:\conda install theano
(neuralnets) C:\conda install mingw libpython
(neuralnets) C:\pip install tensorflow
(neuralnets) C:\pip install keras

Codebeispiel reproduzieren:

Habe diesen Befehl ausgeführt:

(neuralnets) C:\python -c "from keras import backend; print(backend._BACKEND)"

Habe folgenden Fehler:

Traceback (most recent call last):
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\multiarray.py", line 12, in <module>
    from . import overrides
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\__init__.py", line 2, in <module>
    from . import np_utils
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\np_utils.py", line 6, in <module>
    import numpy as np
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 47, in <module>
    raise ImportError(msg)
ImportError:
import numpy as np
<< your code here >>

Fehlermeldung:

Numpy/Python-Versionsinformationen:

Kann jemand bitte helfen? Ich bin neu in der Verwendung von Keras und Tensorflow. Ich benutze es für einen Kurs, den ich dieses Semester besuche.

Vielen Dank

29 - InteAnaconda

Hilfreichster Kommentar

pip install tensorflow hat numpy von PyPI abgeholt. Versuchen

pip uninstall numpy
conda install numpy

das wird wahrscheinlich die dinge beheben

Alle 23 Kommentare

Wahrscheinlich ein Duplikat von #12957 aufgrund von ContinuumIO/anaconda-issues#10628 . Kopierter Kommentar aus dem doppelten Problem:

Es gibt einen Unterschied zwischen dem Speicherort der zusätzlichen Support-Bibliotheken, die mit Anaconda geliefert werden, und denen, die mit Stock numpy geliefert werden, die Sie von pip install . Dies erfordert Anpassungen an der Variablen PATH . Möglicherweise schlagen die PATH Anpassungen beim Import fehl. Existiert das Verzeichnis site-packages\numpy\.libs und enthält es *.dll Dateien? Wenn ja, können Sie versuchen, dieses Verzeichnis Ihrem PATH voranzustellen, bevor Sie Python ausführen:

rem This fails
python -c "import numpy"

rem Does this succeed ??? 
PATH=path\to\site-packages\numpy\.libs;%PATH%
python -c "import numpy"

Aber in Ihrem Fall ist etwas anders, der Pfad zu numpy fehlt ein Pfadtrennzeichen: C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.py sollte C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py . Ist das ein Copy-Paste-Fehler?

im Pfad zu numpy fehlt ein Pfadtrennzeichen:

Nur ein Github-Formatierungsproblem, das in ``` einpackte, ließ das verschwinden

@bsathyan : Sie haben uns nicht die vollständige Fehlermeldung angezeigt. Können Sie auch den Teil einfügen, der nach dem letzten ImportError ?

@eric-wieser unten angehängt ist der vollständige Fehlerthread. Bitte lassen Sie es mich wissen, wenn Sie noch etwas benötigen.

Vielen Dank :)

(neuralnets) C:\Users\Z0035HPP>python -c "from keras import backend; print(backend._BACKEND)"
Traceback (most recent call last):
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\multiarray.py", line 12, in <module>
    from . import overrides
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\__init__.py", line 2, in <module>
    from . import np_utils
  File "C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\lib\site-packages\keras\utils\np_utils.py", line 6, in <module>
    import numpy as np
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 47, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using C:\Users\Z0035HPP\AppData\Local\Continuum\anaconda3\envs\neuralnets\python.exe),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'

ich stehe auch vor dem gleichen Problem.

Traceback (most recent call last):
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
    from . import overrides
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\numpy\core\overrides.py", line 9, in <module>
    from numpy.core._multiarray_umath import add_docstring, ndarray
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:/Python Programs/Final Project/scratch_6.py", line 1, in <module>
    import tensorflow as tf
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\tensorflow\python\__init__.py", line 47, in <module>
    import numpy as np
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "F:\Anaconda\envs\Final_Project\lib\site-packages\numpy\core\__init__.py", line 47, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using F:\Anaconda\envs\Final_Project\python.exe),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

Hat der im obigen Kommentar vorgeschlagene Fix geholfen? Dies ist ein bekanntes Problem bei Anaconda.

Nein, der Pfad war für mich schon richtig. Und ja, das ist ein Problem mit Anaconda. Ich habe Virtual Environment für den gleichen Code verwendet und es lief recht gut. Mit Anakonda stimmt wahrscheinlich etwas nicht.

pip install tensorflow hat numpy von PyPI abgeholt. Versuchen

pip uninstall numpy
conda install numpy

das wird wahrscheinlich die dinge beheben

Hi,
Ich bin auf das gleiche Problem gestoßen und habe den Rat befolgt, numpy mit pip zu deinstallieren und mit conda erneut zu installieren - war jedoch nicht erfolgreich.
Ich habe jedoch versucht, tensorboard mit dem folgenden ImportError zum Laufen zu bringen, der nicht genau gleich ist, aber möglicherweise verwandt ist:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-26 21:41:23.671349: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 
Abort trap: 6

Hi,
Ich bin auf das gleiche Problem gestoßen und habe den Rat befolgt, numpy mit pip zu deinstallieren und mit conda erneut zu installieren - war jedoch nicht erfolgreich.
Ich habe jedoch versucht, tensorboard mit dem folgenden ImportError zum Laufen zu bringen, der nicht genau gleich ist, aber möglicherweise verwandt ist:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-26 21:41:23.671349: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 
Abort trap: 6

Betreibst du Tensorlow mit einem 3.6 Python? Tensorflow funktioniert einfach nicht mit Python 3.7.
Ich schlage vor, dass Sie dies tun:

  1. Erstellen Sie eine neue 3.6-Python-Umgebung, indem Sie dies vom Terminal aus ausführen, vorausgesetzt, Sie haben Anaconda:
    conda create --name tensorflow python=3.6

    1. Tensorflow aktivieren:

      Tensorflow aktivieren

  2. Einmal aktiviert, versuchen Sie, alle Ihre Pakete zu installieren.

Hallo @mjahmad ,
Danke für deine Antwort. Tatsächlich verwende ich Python 3.6.7 in meiner Umgebung

Okay, ich habe es jetzt verstanden. Nur zum Teilen, falls etwas Nützliches für Sie dabei sein könnte.
Ich habe tensorflow wieder deinstalliert und nur die Version 1.12 von Tensorboard installiert:
pip install tensorboard==1.12
Funktioniert jetzt

Hi!
Es ist mir gelungen, tensorflow in Python3.7 zu installieren

  • Fehler bei der ersten Installation Meldung: ModuleNotFoundError: Kein Modul namens 'numpy.core._multiarray_umath'
  • ModuleNotF oundError:Kein Modul namens 'numpy.core._multiarray_umath'

pip deinstallieren numpy
pip install numpy
pip deinstallieren tensorflow
pip installieren tensorflow

Tensorflow als tf importieren
Erfolg :> danke

pip install tensorflow hat numpy von PyPI abgeholt. Versuchen

pip uninstall numpy
conda install numpy

das wird wahrscheinlich die dinge beheben

Das hat mein Problem gelöst, danke

Hallo,

Ich habe das gleiche Problem und habe es mit 3.7 und 3.6 Umgebung versucht. Aber es kommt immer noch folgender Fehler:

von keras.models importieren Sequential

Verwenden des TensorFlow-Back-Ends.

ModuleNotFoundError Traceback (letzter Aufruf zuletzt)
ModuleNotFoundError: Kein Modul namens 'numpy.core._multiarray_umath'

!pip uninstall numpy
funktioniert nicht. Es läuft und läuft ohne Ergebnis.

Vielen Dank!

Okay, Entschuldigung, ich habe das Problem gelöst. Vielleicht hilft es dir:
Aktualisieren Sie auf die neueste Version von numpy :D
!pip install --upgrade numpy


Hi
Vielen Dank, dass Sie mir diese Mail geschickt haben.
Helft euch gegenseitig, schwierige Problemlösungen miteinander zu teilen
Lass es uns tun. Hab heute einen schönen Tag.
Die Welt gehört dir. : D
-----Originale Nachricht-----
Von: "mario" [email protected]
An: "numpy/numpy" [email protected] ;
Cc: "kobilinux" [email protected] ; "Kommentar" [email protected] ;
Gesendet: 2019-03-14 (목) 06:21:15 (GMT+09:00)
Betreff: Re: [numpy/numpy] Kein Modul namens 'numpy.core._multiarray_umath' (#12977)

Hallo,
Ich habe das gleiche Problem und habe es mit 3.7 und 3.6 Umgebung versucht. Aber es kommt immer noch folgender Fehler:
von keras.models importieren Sequential

Verwenden des TensorFlow-Back-Ends.

ModuleNotFoundError Traceback (letzter Aufruf zuletzt)
ModuleNotFoundError: Kein Modul namens 'numpy.core._multiarray_umath'
!pip deinstallieren numpy
funktioniert nicht. Es läuft und läuft ohne Ergebnis.
Vielen Dank!

Okay, Entschuldigung, ich habe das Problem gelöst. Vielleicht hilft es dir:
Aktualisieren Sie auf die neueste Version von numpy :D
!pip install --upgrade numpy

Sie erhalten dies, weil Sie einen Kommentar abgegeben haben.
Antworten Sie direkt auf diese E-Mail, zeigen Sie sie auf GitHub an oder schalten Sie den Thread stumm.

Schließen. Hoffentlich wurden diese Probleme auf Anaconda-Seite gelöst und einige der Vorschläge hier erscheinen suboptimal. Die beste Lösung scheint zu sein

pip uninstall numpy
conda install numpy

Hi!
Es ist mir gelungen, tensorflow in Python3.7 zu installieren

  • Fehler bei der ersten Installation Meldung: ModuleNotFoundError: Kein Modul namens 'numpy.core._multiarray_umath'
  • ModuleNotF oundError:Kein Modul namens 'numpy.core._multiarray_umath'

pip deinstallieren numpy
pip install numpy
pip deinstallieren tensorflow
pip installieren tensorflow

Tensorflow als tf importieren
Erfolg :> danke

das hat bei mir funktioniert, danke

Hallo
Ich erhalte beim Zugriff auf Tensorflow den gleichen Fehler wie unten.

ModuleNotFoundError Traceback (letzter Aufruf zuletzt)ModuleNotFoundError: Kein Modul namens 'numpy.core._multiarray_umath'

Solloution :- Aktualisieren Sie Numpy mit der neuesten Version

setp um numpy wie folgt zu aktualisieren

setp1 öffnen cmd
setp2 schreibe pip install numpy== neueste Version und drücke Enter
Beispiel pip install numpy==1.16.2

pip install tensorflow hat numpy von PyPI abgeholt. Versuchen

pip uninstall numpy
conda install numpy

das wird wahrscheinlich die dinge beheben

Das hat bei mir auch funktioniert. Es sieht so aus, als hätte Pip bei der Installation von Tensorflow eine zweite Version von numpy hinzugefügt

Ich hatte den gleichen Fehler, ich habe ihn gelöst, indem ich eine virtuelle Umgebung mit Anaconda erstellt und dann die erforderlichen Bibliotheken installiert habe, es hat funktioniert.

Ich hatte das gleiche Problem und bin irgendwie durch das Laufen daran vorbeigekommen
```
pip deinstallieren numpy
conda installieren numpy
pip install numpy

Es sieht so aus, als ob dieser Fehler darauf zurückzuführen ist, dass mehrere Pakete in Ihrer spezifischen Umgebung nicht richtig installiert sind. Für mich wurde Jupyter Notebook nicht in dieser speziellen virtuellen Umgebung installiert. Ich bin den obigen Kommentaren gefolgt:

pip uninstall numpy
conda install numpy
pip install numpy 

Und dann hat es folgendes behoben:

conda install jupyter
conda install -c conda-forge matplotlib 
conda install -c anaconda pandas

Wenn Sie nun das Jupyter-Notebook aus der Umgebung öffnen und Folgendes schreiben:

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf

es gibt keine fehler.

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

navytux picture navytux  ·  4Kommentare

kevinzhai80 picture kevinzhai80  ·  4Kommentare

qualiaa picture qualiaa  ·  3Kommentare

Kreol64 picture Kreol64  ·  3Kommentare

toddrjen picture toddrjen  ·  4Kommentare