Astropy抱怨Numpy版本

时间:2019-03-10 00:33:42

标签: python numpy astropy

我刚刚将Astropy更新为版本3.1.2。现在,我正在尝试运行一个使用该脚本的(以前有效的)Python 3脚本,但它失败并显示以下消息:

Traceback (most recent call last):
  File "./body-local.py", line 3, in <module>
    from astropy.time import Time
  File "/home/jimc/.local/lib/python3.6/site-packages/astropy/__init__.py", line 121, in <module>
    _check_numpy()
  File "/home/jimc/.local/lib/python3.6/site-packages/astropy/__init__.py", line 115, in _check_numpy
    raise ImportError(msg)
ImportError: Numpy version 1.13.0 or later must be installed to use Astropy

我安装的Numpy版本是1.16.2。

1 个答案:

答案 0 :(得分:1)

我的Numpy安装错误。解决方案是以普通用户和root身份反复卸载Numpy,直到找不到更多安装,然后重新安装:

pip3 uninstall numpy
sudo pip3 uninstall numpy

^直到没有更多剩余,然后:

sudo pip3 install numpy