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.
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 .
Install SciPy using pip We can install the SciPy library by using pip command; run the following command in the terminal: pip install scipy.
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.
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
>>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With