Numpy: Tidak ada modul bernama 'numpy.core._multiarray_umath'

Dibuat pada 16 Feb 2019  ·  23Komentar  ·  Sumber: numpy/numpy

Saya baru saja menginstal TensorFlow, Keras di anaconda3.

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

Contoh kode reproduksi:

Menjalankan perintah ini:

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

Mendapat kesalahan berikut:

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 >>

Pesan eror:

Informasi versi Numpy/Python:

Dapatkah seseorang tolong bantu? Saya baru menggunakan keras dan tensorflow. Saya menggunakannya untuk kelas yang saya ambil semester ini.

Terima kasih

29 - InteAnaconda

Komentar yang paling membantu

pip install tensorflow mengambil numpy dari PyPI. Mencoba

pip uninstall numpy
conda install numpy

itu mungkin akan memperbaiki keadaan

Semua 23 komentar

Mungkin duplikat #12957 karena ContinuumIO/anaconda-issues#10628 . Komentar yang disalin dari masalah duplikat:

Ada perbedaan antara lokasi perpustakaan dukungan tambahan yang disertakan dengan anaconda dan yang disertakan dengan stock numpy yang Anda dapatkan dari pip install . Ini membutuhkan penyesuaian pada variabel PATH . Mungkin penyesuaian PATH gagal saat diimpor. Apakah direktori site-packages\numpy\.libs ada dan apakah itu berisi file *.dll ?, Jika demikian, dapatkah Anda mencoba menambahkan direktori itu ke PATH sebelum menjalankan python:

rem This fails
python -c "import numpy"

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

Tetapi dalam kasus Anda ada sesuatu yang berbeda, jalur ke numpy tidak memiliki pemisah jalur: C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.py seharusnya C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py . Apakah itu kesalahan copy paste?

jalur ke numpy tidak memiliki pemisah jalur:

Hanya masalah pemformatan github, membungkus ``` membuatnya hilang

@bsathyan : Anda belum menunjukkan kepada kami pesan kesalahan lengkap. Bisakah Anda menempelkan bagian yang muncul setelah ImportError juga?

@eric-wieser terlampir di bawah ini adalah utas kesalahan lengkap. Tolong beri tahu saya jika Anda membutuhkan yang lain.

Terima kasih :)

(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'

Saya juga menghadapi masalah yang sama.

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.

Apakah perbaikan yang disarankan dalam komentar di atas membantu? Ini adalah masalah yang diketahui dengan Anaconda.

Tidak, jalurnya sudah benar untuk saya. Dan ya, ini adalah masalah dengan anaconda. Saya menggunakan Lingkungan Virtual untuk kode yang sama dan itu berjalan cukup baik. Sepertinya ada yang salah dengan anaconda.

pip install tensorflow mengambil numpy dari PyPI. Mencoba

pip uninstall numpy
conda install numpy

itu mungkin akan memperbaiki keadaan

Hai,
Saya mengalami masalah yang sama dan mengikuti saran untuk menghapus numpy menggunakan pip dan menginstalnya lagi dengan conda - tetapi tidak berhasil.
Namun, saya mencoba menjalankan tensorboard dengan ImportError berikut, tidak persis sama, tetapi mungkin terkait:

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

Hai,
Saya mengalami masalah yang sama dan mengikuti saran untuk menghapus numpy menggunakan pip dan menginstalnya lagi dengan conda - tetapi tidak berhasil.
Namun, saya mencoba menjalankan tensorboard dengan ImportError berikut, tidak persis sama, tetapi mungkin terkait:

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

Apakah Anda menjalankan tensorlow menggunakan python 3.6? Tensorflow sama sekali tidak berfungsi dengan python 3.7.
Saya sarankan Anda melakukan ini:

  1. Buat lingkungan python 3.6 baru, Anda dapat melakukan ini dengan menjalankan ini dari terminal, dengan asumsi Anda memiliki anaconda:
    conda create --name tensorflow python=3.6

    1. mengaktifkan tensorflow:

      aktifkan tensorflow

  2. setelah diaktifkan, coba instal semua paket Anda.

Hai @mjahmad ,
Terima kasih untuk balasan Anda. Memang saya menjalankan Python 3.6.7 di lingkungan saya

Oke, saya mengerti sekarang. Sekedar berbagi jika mungkin ada sesuatu yang berguna untuk Anda.
Saya menghapus tensorflow lagi dan hanya menginstal versi 1.12 dari tensorboard:
pip install tensorboard==1.12
Bekerja sekarang

Hai!
Saya berhasil menginstal tensorflow di python3.7

  • Gagal pada pemasangan pertama Pesan: ModuleNotFoundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'
  • ModuleNotF oundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'

pip uninstall numpy
pip install numpy
pip uninstall tensorflow
pip instal tensorflow

impor tensorflow sebagai tf
sukses :> terimakasih

pip install tensorflow mengambil numpy dari PyPI. Mencoba

pip uninstall numpy
conda install numpy

itu mungkin akan memperbaiki keadaan

Ini menyelesaikan masalah saya, terima kasih

Halo,

Saya memiliki masalah yang sama dan mencobanya dengan lingkungan 3.7 dan 3.6. Tetapi masih ada kesalahan berikut:

dari keras.models import Sequential

Menggunakan backend TensorFlow.

ModuleNotFoundError Traceback (panggilan terakhir terakhir)
ModuleNotFoundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'

!pip uninstall numpy
tidak bekerja. Itu berjalan dan berjalan tanpa hasil apa pun.

Terima kasih!

Oke, maaf teman saya memecahkan masalah. Mungkin itu akan membantu Anda:
Perbarui ke versi terbaru dari numpy :D
!pip install --upgrade numpy

kami
Hai
Terima kasih telah mengirimkan saya surat ini.
Saling membantu untuk berbagi pemecahan masalah yang sulit satu sama lain
Ayo lakukan. Semoga hari ini menyenangkan.
Dunia adalah milikmu. : D
-----Pesan asli-----
Dari: "mario" [email protected]
Kepada: "numpy/numpy" [email protected] ;
Cc: "kobilinux" [email protected] ; "Komentar" [email protected] ;
Dikirim: 14-03-2019 (목) 06:21:15 (GMT+09:00)
Subjek: Re: [numpy/numpy] Tidak ada modul bernama 'numpy.core._multiarray_umath' (#12977)

Halo,
Saya memiliki masalah yang sama dan mencobanya dengan lingkungan 3.7 dan 3.6. Tetapi masih ada kesalahan berikut:
dari keras.models import Sequential

Menggunakan backend TensorFlow.

ModuleNotFoundError Traceback (panggilan terakhir terakhir)
ModuleNotFoundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'
!pip uninstall numpy
tidak bekerja. Itu berjalan dan berjalan tanpa hasil apa pun.
Terima kasih!

Oke, maaf teman saya memecahkan masalah. Mungkin itu akan membantu Anda:
Perbarui ke versi terbaru dari numpy :D
!pip install --upgrade numpy

Anda menerima ini karena Anda berkomentar.
Balas email ini secara langsung, lihat di GitHub, atau matikan utasnya.

Penutupan. Semoga masalah ini telah diselesaikan di pihak Anaconda, dan beberapa saran di sini tampaknya kurang optimal. Solusi terbaik tampaknya

pip uninstall numpy
conda install numpy

Hai!
Saya berhasil menginstal tensorflow di python3.7

  • Gagal pada pemasangan pertama Pesan: ModuleNotFoundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'
  • ModuleNotF oundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'

pip uninstall numpy
pip install numpy
pip uninstall tensorflow
pip instal tensorflow

impor tensorflow sebagai tf
sukses :> terimakasih

ini bekerja untuk saya, terima kasih

Halo
saya mendapatkan kesalahan yang sama saat mengakses tensorflow seperti di bawah ini.

ModuleNotFoundError Traceback (panggilan terakhir terakhir)ModuleNotFoundError: Tidak ada modul bernama 'numpy.core._multiarray_umath'

Solusi :- Perbarui Numpy dengan versi terbaru

setp untuk memperbarui numpy sebagai berikut

setp1 buka cmd
setp2 tulis pip install numpy== versi terbaru dan tekan Enter
contoh pip install numpy==1.16.2

pip install tensorflow mengambil numpy dari PyPI. Mencoba

pip uninstall numpy
conda install numpy

itu mungkin akan memperbaiki keadaan

Ini bekerja untuk saya juga. Sepertinya pip menginstal tensorflow menambahkan versi kedua dari numpy

Saya memiliki jenis kesalahan yang sama, saya menyelesaikannya dengan membuat lingkungan virtual menggunakan anaconda, lalu menginstal perpustakaan yang diperlukan, itu berhasil.

Saya memiliki masalah yang sama dan entah bagaimana berhasil melewatinya dengan berlari
```
pip uninstall numpy
conda install numpy
pip install numpy

Sepertinya kesalahan ini karena beberapa paket tidak diinstal dengan benar di env spesifik Anda. Bagi saya, notebook jupyter tidak diinstal di lingkungan virtual tertentu. Saya mengikuti komentar di atas:

pip uninstall numpy
conda install numpy
pip install numpy 

Dan kemudian yang berikut ini memperbaikinya:

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

Sekarang ketika Anda membuka notebook jupyter dari lingkungan dan menulis yang berikut:

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

tidak ada kesalahan.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat