Astropy complaining about Numpy version

南楼画角 提交于 2020-05-16 13:34:34

问题


I just updated Astropy to version 3.1.2. Now I'm trying to run a (previously working) Python 3 script that uses it, and it's failing with the following message:

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

My installed Numpy version is 1.16.2.


回答1:


I had a bad Numpy installation. The solution was to repeatedly uninstall Numpy, as regular user and root, until no more installations were found, then reinstall:

pip3 uninstall numpy
sudo pip3 uninstall numpy

^ Until no more remain, then:

sudo pip3 install numpy


来源:https://stackoverflow.com/questions/55083379/astropy-complaining-about-numpy-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!