New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: numpy.core._multiarray_umath failed to import #11871
Comments
I feel like this could be some system issue as well, because even an older numpy is giving me this same error |
We need more information to help you. Does |
Hi @mattip: It's the latter (as in: I can Here's the full trace (I am using the latest Miniconda shell file): Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import numpy as np
In [2]: import tensorflow as tf
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core._multiarray_umath failed to import
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core._multiarray_umath failed to import
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core._multiarray_umath failed to import
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
ImportError: numpy.core._multiarray_umath failed to import
In [3]: np.__version__
Out[3]: '1.15.1' |
I've always been building Numpy and Scipy from source since I wanted to link to my local MKL, but when I started getting the ImportError, I started fiddling around with |
That's strange, the |
If you are using development numpy, might want to recompile tensorflow if that is possible. |
And maybe delete all installed non-system numpy versions and reinstall. |
Thanks @charris ! It almost certainly looks like there was some bad cache causing this import error; I just built a clean Docker and just tested numpy (both pip and build) and Tensorflow (just pip for now) imports, and both versions of numpy checked out all good when importing TF! I'll continue to install other packages and report back on whether it really was a bad coincidence, or whether there's some other packages doing something naughty along the way! |
Yep things are all good! Thanks for the fast replies, closing now (still not sure why things went wrong, but at least it works now!). |
Link to #10915 code reorganization PR. |
Hi, facing the same issue with Django (warning with the exact same error), and any re-install, clear cache (pip) not working. Any idea why this is happening? |
@amehrdad88 this is unrelated to Django. What matters is how you installed Python, and how you installed NumPy and the other packages you use that depend on NumPy. Check you are using what you think you are using (e.g. everything from the same virtualenv / conda env) by looking at tracebacks or inspecting |
Ok thanks I will check though I just used the Python installer from the official website, then virtualenv and everything else from pip so shouldn't pose any major problem! I'll try reinstalling everything. |
@rgommers seems to be a problem with other packages but not sure which. I re-installed everything and had the same problem, so I just created a test venv with only numpy and tensorflow; importing tensorflow works. When I then install the other packages (with pip) from a requirements.txt file the error appears again when I try to import tensorflow. Could it be that one of the packages being loaded is has an error with regards to numpy in it? Would this package be loaded even if I only import tensorflow? Note: I also had a warning "FutureWarning: Conversion of the second argument of issubdtype from |
@amehrdad88 this issue is closed. Please document exactly what commands you are executing, and try to import tensorflow after each step subsequent to installing tensorflow. If you still think the issue is with NumPy and not another package, open a new issue and attach the documentation together with the output. |
no, that is quite unlikely. what is happening is probably |
I am starting to get this behavior when building my application on CircleCI. In the shell:
This build was working fine 4 days ago, but now my build is failing with no changes to requirements.txt at all. Did something recently change? I'm running numpy 1.14.3 and pandas 0.20.3 |
Just as a followup, |
i have same problem, everything was working fine 3 days back. Now suddenly there is this import error when i try to load pickled files |
The c-extension module |
I am getting a similar issue when trying to load pickled files:
|
Maybe this should be reopened. Not sure if this is relevant. Also getting this when trying to use Full Traceback
|
@rileypeterson this may be a duplicate of issue #12837. In any case, the pickling problems with 1.16.0 are fixed by #12842 (backported to 1.16.1 in #12869). It will be solved with the release of 1.16.1. |
pip install --upgrade numpy this removes the previous version and install the newer version .. this solved the issued for me |
I get the same problem, numpy.core._multiarray_umath failed to import |
A recent release of NumPy introduced a new module _multiarray_umath. Unfortunately, there are some tools that depend on NumPy and pull in the latest version as a build dependency. This latest version is then replaced with the version specified in our requirements.txt, thus the module is not available at run-time causing the segfaults. By installing NumPy separately before requirements.txt is gathered, we ensure that whatever was using the most recent version of NumPy in its installation now uses the pre-installed one. We'll have to ensure that the version of NumPy in requirements.txt matches the one in Ansible. For details see: numpy/numpy#11871 https://stackoverflow.com/q/54153886
A recent release of NumPy introduced a new module _multiarray_umath. Unfortunately, there are some tools that depend on NumPy and pull in the latest version as a build dependency. This latest version is then replaced with the version specified in our requirements.txt, thus the module is not available at run-time causing the segfaults. By installing NumPy separately before requirements.txt is gathered, we ensure that whatever was using the most recent version of NumPy in its installation now uses the pre-installed one. We'll have to ensure that the version of NumPy in requirements.txt matches the one in Ansible. For details see: numpy/numpy#11871 https://stackoverflow.com/q/54153886
I finally figure it out,It is because the numpy version is too low,upgrade numpy to 1.16.2,and everything is fine |
numpy的卸载再更新升级 |
pip install -U numpy升级numpy 就可以了 |
This did the trick :) |
in anaconda prompt: then: worked for me! |
I have faced the same issue.
|
就服你!别人英文提问,你中文回答! |
@datianshi21 our official language is English. Google translate says your comment is "Numpy uninstall and update |
Everything worked after uninstalling |
It started working for me when I installed pandas. Not idea why. |
Pandas install numpy as dependency. |
Hello,
There's a bunch of packages which I'm installing that requires NumPy (for example TensorFlow), and I can't seem to be able to install and import them because of an ImportError on the numpy side.
This is happening with both
pip install
and building from source.Reproducing code example:
Error message:
Numpy/Python version information:
The text was updated successfully, but these errors were encountered: