简体   繁体   中英

Python error: “ImportError: cannot import name isnat”

Python is throwing the following error:

File "C:\Python27\Lib\site-packages\numpy\core\arrayprint.py", line 42
    from .umath import absolute, not_equal, isnan, isinf, isfinite, isnat   
ImportError: cannot import name isnat

It is weird because I haven't able to find the isnat documentation. My numpy version is 1.14.0, which seems to be the only library that cannot be loaded from .umath .

I had the same issue, and likewise reinstalling using the command from https://stackoverflow.com/a/40366276/1283083 did not help.

However, I was able to get numpy to import by running the following command from the command prompt as admin:

pip install -U --force-reinstall numpy

Not sure why exactly that worked, but numpy loads in my IDE now. I got the command from https://github.com/dwhswenson/contact_map/blob/master/docs/installing.rst

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM