"ImportError: no scipy module" after installing the scipy package

So, I recently tried installing scipy on my Raspbian operating system (Debian for raspberries) using sudo pip install scipy . The team worked without any problems, and I see the file located under pi/build/scipy .

However, when I actually try to import it into a python program, it gives me ImportError: No module named scipy I'm not quite sure how to do this, pointing the OS to the right place to import the scipy module.

+6
source share
2 answers

If you are not inside the environment, this will not work at all. I would recommend you install the python-scipy instead, which would assure you that it would 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 >>> 
+6
source

I think you have a permission issue after installation using sudo pip . (

A quick fix to this problem could be to install scipy with

 sudo -i pip install scipy 

To get sudo -install working, you may need to change your default umask ( umask 0022 ).

-2
source

Source: https://habr.com/ru/post/971889/


All Articles