【问题标题】:Python error: "ImportError: cannot import name isnat"Python 错误:“ImportError: cannot import name isnat”
【发布时间】:2018-01-29 15:38:42
【问题描述】:

Python 抛出以下错误:

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

这很奇怪,因为我找不到 isnat 文档。我的numpy版本是1.14.0,好像是唯一不能从.umath加载的库。

【问题讨论】:

标签: python numpy pip vpython


【解决方案1】:

我遇到了同样的问题,同样使用来自https://stackoverflow.com/a/40366276/1283083 的命令重新安装也没有帮助。

但是,我可以通过在命令提示符下以管理员身份运行以下命令来导入 numpy:

pip install -U --force-reinstall numpy

不知道为什么它确实有效,但现在我的 IDE 中加载了 numpy。我从https://github.com/dwhswenson/contact_map/blob/master/docs/installing.rst得到命令

【讨论】:

    猜你喜欢
    • 2011-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 1970-01-01
    • 2020-07-07
    • 2013-02-25
    相关资源
    最近更新 更多