我正在尝试在 Windows 上的 Python 2.7.10 中导入 numpy 和 scipy
我无法通过 pip 或提供的二进制文件安装 scipy:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
但是听说Anaconda标配了numpy和scipy。值得注意的是我可以成功导入 numpy。
conda list
打印出所有包,scipy 是其中之一,但导入仍然失败。
当我运行时
$ conda install scipy
这是我看到的:
$ conda install scipy
Fetching package metadata: ....
Solving package specifications: ..................
Package plan for installation in environment c:\Users\Nick\Anaconda2:
The following NEW packages will be INSTALLED:
conda-env: 2.4.4-py27_1
Proceed ([y]/n)? y
Linking packages ...
"Ensuring that c:\Users\Nick\Anaconda2\Library\bin is on user PATH environment variable."
"" was unexpected at this time.
Error: Error: post-link failed for: conda-env-2.4.4-py27_1
当我运行时
$ conda install -f scipy
这是我看到的:
$ conda install -f scipy
Fetching package metadata: ....
Solving package specifications: ..................
Package plan for installation in environment c:\Users\Nick\Anaconda2:
The following packages will be UPDATED:
scipy: 0.16.0-np110py27_0 --> 0.16.0-np110py27_0
Proceed ([y]/n)? y
[ COMPLETE ]|##################################################| 100%
Extracting packages ...
[ COMPLETE ]|##################################################| 100%
Unlinking packages ...
[ COMPLETE ]|##################################################| 100%
Linking packages ...
[ COMPLETE ]|##################################################| 100%
它似乎可以工作,但是当我尝试在我的 Python 程序顶部导入 scipy 时,我得到:
$ python steps.py
Traceback (most recent call last):
File "steps.py", line 16, in <module>
import scipy as st
ImportError: No module named scipy
我是不是输入错误了?
最佳答案
根据我的研究,尤其是 github.com/conda/conda/issues/1786我相信 Anaconda 2.4.0 不适合 scipy。解决方案是获取更新版本的 Anaconda 或考虑安装最新的 Miniconda。
关于python - 安装Anaconda2.4.0后无法导入scipy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33574740/