Numpy无法在Spyder中导入

时间:2019-10-11 10:11:12

标签: python numpy spyder

当尝试在spyder中导入numpy时,出现以下错误消息:

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.

- Try uninstalling and reinstalling numpy.

- If you have already done that, then:

1. Check that you expected to use Python3.7 from "/home/sltzgs/anaconda3/bin/python",and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.17.2" you're trying to use.

2. If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on: - how you installed Python - how you installed numpy - your operating system - whether or not you have multiple versions of Python installed - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try git clean -xdf (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'

但是,导入jupyter笔记本可以正常工作。那怎么可能? 到目前为止,我已经卸载/安装了numpy几次,并且还确保sys.paths相同。

任何帮助表示赞赏。如果需要任何其他信息,我会很乐意提供帮助。谢谢。

一些要点: python 3.7 间谍3.3.6 numpy 1.17.2

1 个答案:

答案 0 :(得分:1)

重新安装Anaconda之后,问题不再出现。谢谢@CarlosCordoba。