Acabei de instalar o TensorFlow, Keras no 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
Executou este comando:
(neuralnets) C:\python -c "from keras import backend; print(backend._BACKEND)"
Recebi o seguinte erro:
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 >>
Alguém pode ajudar por favor? Eu sou novo no uso de keras e tensorflow. Estou usando para uma aula que estou fazendo neste semestre.
Obrigado
Provavelmente uma duplicata de # 12957 devido a ContinuumIO / anaconda-issues # 10628 . Comentário copiado do problema duplicado:
Há uma diferença entre a localização das bibliotecas de suporte extras fornecidas com o anaconda e aquelas fornecidas com o estoque numpy que você obtém em pip install
. Isso requer ajustes na variável PATH
. Talvez os PATH
ajustes estejam falhando na importação. O diretório site-packages\numpy\.libs
existe e contém *.dll
arquivos ?, Em caso afirmativo, você pode tentar adicionar esse diretório ao seu PATH
antes de executar o python:
rem This fails
python -c "import numpy"
rem Does this succeed ???
PATH=path\to\site-packages\numpy\.libs;%PATH%
python -c "import numpy"
Mas no seu caso algo está diferente, o caminho para numpy está faltando um separador de caminho: C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.py
deve ser C:\Users\Z0035HPP\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py
. Isso é um erro de copiar e colar?
o caminho para numpy está sem um separador de caminho:
Apenas um problema de formatação do github, envolver em ```
fez com que ele desaparecesse
@bsathyan : Você não nos mostrou a mensagem de erro completa. Você pode colar a parte que vem depois do último ImportError
também?
@ eric-wieser anexado abaixo é o encadeamento de erro completo. Por favor, deixe-me saber se você precisar de mais alguma coisa.
Obrigado :)
(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'
Eu também estou enfrentando o mesmo problema.
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.
A correção sugerida no comentário acima ajudou? Este é um problema conhecido do Anaconda.
Não, o caminho já estava correto para mim. E sim, este é um problema com a anaconda. Usei o ambiente virtual para o mesmo código e funcionou muito bem. Parece que algo está errado com o anaconda.
pip install tensorflow
pegou numpy do PyPI. Experimente
pip uninstall numpy
conda install numpy
isso provavelmente vai consertar as coisas
Oi,
Encontrei o mesmo problema e segui o conselho para desinstalar o numpy usando pip e instalá-lo novamente com conda - mas não foi bem-sucedido.
No entanto, eu estava tentando colocar tensorboard
em execução com o seguinte ImportError, não exatamente o mesmo, mas talvez relacionado:
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
Oi,
Encontrei o mesmo problema e segui o conselho para desinstalar o numpy usando pip e instalá-lo novamente com conda - mas não foi bem-sucedido.
No entanto, eu estava tentando colocartensorboard
em execução com o seguinte ImportError, não exatamente o mesmo, mas talvez relacionado: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
Você está executando o tensorlow usando um 3.6 python? O Tensorflow simplesmente não funciona com o Python 3.7.
Eu sugiro que você faça isso:
Olá @mjahmad ,
Obrigado pela sua resposta. Na verdade, estou executando Python 3.6.7
em meu ambiente
OK, entendi agora. Apenas para compartilhar, caso haja algo útil para você.
Desinstalei tensorflow
novamente e instalei apenas a versão 1.12
do tensorboard:
pip install tensorboard==1.12
Funciona agora
Oi!
Consegui instalar o tensorflow em python3.7
pip desinstalação numpy
pip install numpy
pip desinstalação tensorflow
pip instalar tensorflow
importar tensorflow como tf
sucesso:> obrigado
pip install tensorflow
pegou numpy do PyPI. Experimentepip uninstall numpy conda install numpy
isso provavelmente vai consertar as coisas
Isso resolveu meu problema, obrigado
Olá,
Eu tenho o mesmo problema e tentei com ambiente 3.7 e 3.6. Mas ainda há o seguinte erro:
de keras.models import Sequential
Usando o back-end do TensorFlow.
ModuleNotFoundError Traceback (última chamada mais recente)
ModuleNotFoundError: Nenhum módulo denominado 'numpy.core._multiarray_umath'
!pip uninstall numpy
não funciona. Ele é executado e executado sem qualquer resultado.Obrigado!
Ok, desculpe cara, eu resolvi o problema. Talvez isso te ajude:
Atualize para a versão mais recente do numpy: D
!pip install --upgrade numpy
Oi
Obrigado por me enviar este e-mail.
Ajudem uns aos outros a compartilhar a solução de problemas difíceis uns com os outros
Vamos fazê-lo. Tenha um bom dia hoje.
O mundo é seu. : D
-----Mensagem original-----
De: "mario" [email protected]
Para: "numpy / numpy" [email protected] ;
Cc: "kobilinux" [email protected] ; "Comentário" [email protected] ;
Enviado: 14/03/2019 (목) 06:21:15 (GMT + 09: 00)
Assunto: Re: [numpy / numpy] Nenhum módulo chamado 'numpy.core._multiarray_umath' (# 12977)
Olá,
Eu tenho o mesmo problema e tentei com ambiente 3.7 e 3.6. Mas ainda há o seguinte erro:
de keras.models import Sequential
Usando o back-end do TensorFlow.
ModuleNotFoundError Traceback (última chamada mais recente)
ModuleNotFoundError: Nenhum módulo denominado 'numpy.core._multiarray_umath'
! pip desinstalação numpy
não funciona. Ele é executado e executado sem qualquer resultado.
Obrigado!
Ok, desculpe cara, eu resolvi o problema. Talvez isso te ajude:
Atualize para a versão mais recente do numpy: D
! pip install --upgrade numpy
-
Você está recebendo isto porque comentou.
Responda a este e-mail diretamente, visualize-o no GitHub ou ignore a conversa.
Fechando. Esperançosamente, esses problemas foram resolvidos no lado do Anaconda, e algumas das sugestões aqui parecem subótimas. A melhor solução parece ser
pip uninstall numpy
conda install numpy
Oi!
Consegui instalar o tensorflow em python3.7
- Falha na primeira instalação Mensagem: ModuleNotFoundError: Nenhum módulo denominado 'numpy.core._multiarray_umath'
- ModuleNotF oundError: Nenhum módulo denominado 'numpy.core._multiarray_umath'
pip desinstalação numpy
pip install numpy
pip desinstalação tensorflow
pip instalar tensorflowimportar tensorflow como tf
sucesso:> obrigado
isso funcionou para mim, obrigado
Olá
Estou recebendo o mesmo erro ao acessar o tensorflow como abaixo.
ModuleNotFoundError Traceback (última chamada mais recente)ModuleNotFoundError: Nenhum módulo denominado 'numpy.core._multiarray_umath'
Solução: - Atualize o Numpy com a versão mais recente
setp para atualizar numpy como segue
setp1 open cmd
setp2 write pip install numpy == última versão e pressione Enter
exemplo pip install numpy == 1.16.2
pip install tensorflow
pegou numpy do PyPI. Experimentepip uninstall numpy conda install numpy
isso provavelmente vai consertar as coisas
Isso funcionou para mim também. Parece que pip instalando tensorflow adicionou uma segunda versão do numpy
Tive o mesmo tipo de erro, resolvi criando ambiente virtual usando anaconda, depois instalando as bibliotecas necessárias, funcionou.
Eu tive o mesmo problema e de alguma forma superei executando
`` `
pip desinstalação numpy
conda install numpy
pip install numpy
Parece que este erro é devido a vários pacotes não instalados corretamente em seu env específico. Para mim, o notebook jupyter não foi instalado naquele ambiente virtual específico. Eu segui os comentários acima:
pip uninstall numpy
conda install numpy
pip install numpy
E então o seguinte consertou:
conda install jupyter
conda install -c conda-forge matplotlib
conda install -c anaconda pandas
Agora, quando você abre o notebook jupyter do ambiente e escreve o seguinte:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
não há erros.
Comentários muito úteis
pip install tensorflow
pegou numpy do PyPI. Experimenteisso provavelmente vai consertar as coisas