首页 > 解决方案 > PyCharm 2018.2.4 和 Anaconda 5.3.0

问题描述

我的是 Anaconda 5.3.0

当我在 PyCharm 2018.2.4 中运行 .py 时,为什么它显示:

ImportError: 
DLL load failed: The specified module could not be found.

ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

PyCharm 2018.2.4 好像不能导入numpy??

有没有人也看到这个问题?如何解决?非常感谢。

标签: numpypycharmanaconda

解决方案


如果不是解决方案,我相信我有有用的信息。

我也收到了使用 python 从 Windows 命令提示符导入 numpy 的错误。然后我意识到如果我使用 Anaconda 提示符我可以成功。对差异感到好奇,我退出了 python 并检查了 PATH 环境变量。正如我所希望的,它包含 Windows PATH 中不存在的 Anaconda 引用。在命令提示符下,我键入:path > p.txt 并按回车键创建一个文件,因为字符串太长了。当我在记事本中打开文件时,我将 Anaconda 引用复制到剪贴板(C:\Users\laptop\Anaconda3;C:\Users\laptop\Anaconda3\Library\mingw-w64\bin;C:\Users\laptop\Anaconda3 \Library\usr\bin;C:\Users\laptop\Anaconda3\Library\bin;C:\Users\laptop\Anaconda3\Scripts;C:\Users\laptop\Anaconda3\bin; ) 然后使用系统控制面板下的高级设置来编辑环境变量并将其粘贴到 PATH 的开头。在 Windows shell 和 Pycharm 中,这个问题似乎已经消失了。


推荐阅读