我一直在尝试在 Windows 7 上的 PyCharm 中安装 SciPy。但安装过程失败并显示以下错误消息。
然后我按照 install Python package with .whl file 中列出的步骤进行操作,
pip install wheel
pip install some-package.whl
安装过程成功。但是,我仍然无法从 PyCharm
中找到 SciPy 包。
最佳答案
如果您在 Windows 7 上安装 SciPy 时解决了 NumPy/wheel 问题,那么这是一个相对快速的修复方法。简而言之,您需要添加 SciPy 所在的路径(距离 Python 仅几个子文件夹)。您可以在 PyCharm 中看到添加路径的一般摘要 here .
打开一个 Python 解释器,您可以在其中打开 SciPy。
>> import scipy
>> scipy.__file__
"path/to/scipy"
这是我的路径:
C:\Users\ME\AppData\Local\Continuum\Anaconda3\Lib\site-packages\scipy
因此,SciPy 安装在 Continuum 中,而 Python 位于其自己的目录中。 PyCharm 中的默认解释器路径在 Python 目录中查找,如下所示:
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/DLLs
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/Lib
file://C:/Users/ME/AppData/Local/Programs/Python/Python35
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/Lib/site-packages
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/Lib/site-packages/win32
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/Lib/site-packages/win32/lib
file://C:/Users/ME/AppData/Local/Programs/Python/Python35/Lib/site-packages/pythonwin
要解决此问题,请打开 PyCharm 并前往菜单文件 → 设置 → 项目解释器。打开ProjectInterprets,右侧有一个标有“show paths”的小按钮。我将我的路径添加到 SciPy:
file://C:/Users/ME/AppData/Local/Continuum/Anaconda3/Lib/site-packages/
继续在这里添加你的路径,你应该可以开始了!
关于python - 关于从 PyCharm 安装 SciPy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28663601/