简体   繁体   English

Numpy无法在Spyder中导入

[英]Numpy can't be imported in Spyder

When trying to import numpy in spyder i get the following error message:尝试在 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. - 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'

However, importing in a jupyter notebook works fine.但是,在 jupyter notebook 中导入可以正常工作。 How is that possible?这怎么可能? I have uninstalled/installed numpy a few times by now and also made sure, that the sys.paths are identical.我现在已经卸载/安装了几次 numpy 并且还确保 sys.paths 是相同的。

Any help appreciated.任何帮助表示赞赏。 In case any additional information is required I would happily help out.如果需要任何其他信息,我很乐意提供帮助。 Thanks.谢谢。

Some essentials: python 3.7 Spyder 3.3.6 numpy 1.17.2一些要点: python 3.7 Spyder 3.3.6 numpy 1.17.2

Problem did not occur again after re-installing Anaconda.重新安装 Anaconda 后问题不再出现。 Thanks @CarlosCordoba.谢谢@CarlosCordoba。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM