0

尝试在 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, trygit 清理 -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 notebook 中导入可以正常工作。这怎么可能?我现在已经卸载/安装了几次 numpy 并且还确保 sys.paths 是相同的。

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

一些要领:python 3.7 Spyder 3.3.6 numpy 1.17.2

4

1 回答 1

1

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

于 2020-04-14T05:58:11.143 回答