siddharth185 siddharth185 - 1 year ago 1304
Python Question

ImportError: No module named scipy

I am using Python 2.7 and trying to get PyBrain to work.

But I get this error even though scipy is installed -

raceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-
py2.7.egg/pybrain/", line 1, in <module>
from pybrain.structure.__init__ import *
File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/", line 1, in <module>
from pybrain.structure.connections.__init__ import *
File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/connections/", line 1, in <module>
from pybrain.structure.connections.full import FullConnection
File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/connections/", line 3, in <module>
from scipy import reshape, dot, outer
ImportError: No module named scipy

I have installed scipy using this command -

sudo apt-get install python-scipy

I get -

Reading package lists... Done
Building dependency tree
Reading state information... Done
python-scipy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

What do I do?

Answer Source

Try to install it as a python package using pip. You said you already tried:

sudo apt-get install python-scipy

Now run:

pip install scipy

I ran both and it worked on my Debian-based box.