我尝试在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
我做的导入有误吗?
python --version
和where python
。它看起来像是Anaconda Python吗? - JoshAdel$ python --version
Python 2.7.10 :: Anaconda 2.4.0 (64-bit)
- Nick Oliver