简体   繁体   中英

Unable to import scipy after installing Anaconda2.4.0

I'm trying to import numpy and scipy in Python 2.7.10 on Windows

I've been unable to install scipy via pip or the binaries supplied at:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

But I had heard that Anaconda comes standard with numpy and scipy. It's worth noting I can successfully import numpy.

conda list

prints out all packages and scipy is one of them but the import still fails.

When I run

$ conda install scipy

This is what I see:

$ 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

When I run

$ conda install -f scipy

This is what I see:

$ 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%

It appears to be working but when I then try to import scipy at the top of my Python program, I get:

$ python steps.py
Traceback (most recent call last):
  File "steps.py", line 16, in <module>
    import scipy as st
ImportError: No module named scipy 

Am I doing the import wrong?

From my research, especially of github.com/conda/conda/issues/1786 I believe Anaconda 2.4.0 fails for scipy. The solution is to get a newer version of Anaconda or consider installing the latest Miniconda.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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