Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ImportError: No module named scipy" after installing the scipy package

Tags:

python

pip

scipy

So I recently tried to install scipy on my Raspbian (Debian for Raspberry Pi) operating system using sudo pip install scipy. The command worked without too much trouble, and I can see the file located under pi/build/scipy.

However, when I actually try to import it in a python program, it gives me ImportError: No module named scipy I'm not really sure how to go about pointing the OS in the correct location to import the scipy module.

like image 294
Philip R. Avatar asked Jul 07 '14 20:07

Philip R.


People also ask

How do you fix Modulenotfounderror No module named Scipy?

Solution Idea 1: Install Library scipy The most likely reason is that Python doesn't provide scipy in its standard library. You need to install it first! What is this? Before being able to import the Pandas module, you need to install it using Python's package manager pip .

How do I install a Scipy module in Python?

Install SciPy using pip We can install the SciPy library by using pip command; run the following command in the terminal: pip install scipy.

What is Scipy library in Python?

SciPy is a scientific computation library that uses NumPy underneath. SciPy stands for Scientific Python. It provides more utility functions for optimization, stats and signal processing. Like NumPy, SciPy is open source so we can use it freely. SciPy was created by NumPy's creator Travis Olliphant.


1 Answers

Unless you are inside the pip environment it won't work, at all. I would recommend you to install the python-scipy package instead, which would assure you that will work:

➜  ~  sudo apt-get install python-scipy
Selecting previously unselected package python-decorator.
(Reading database ... 252269 files and directories currently installed.)
Preparing to unpack .../python-decorator_3.4.0-2_all.deb ...
Unpacking python-decorator (3.4.0-2) ...
Selecting previously unselected package python-scipy.
Preparing to unpack .../python-scipy_0.13.3-2+b1_i386.deb ...
Unpacking python-scipy (0.13.3-2+b1) ...
Setting up python-decorator (3.4.0-2) ...
Setting up python-scipy (0.13.3-2+b1) ...
➜  ~  python
Python 2.7.7 (default, Jun  3 2014, 23:36:29) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> 
like image 95
Braiam Avatar answered Oct 18 '22 08:10

Braiam