Hi,
How to solve following error:
ImportError: No module named scipy.ndimage
This error is coming while running a python program.
Thanks
Hello,
This error is coming because scipy python package is not installed on your computer.
Error will resolved if you install scipy package. Following is the command to install scipy on Ubuntu 16.04 LTS:
sudo apt-get install python-scipy
Thanks
Hi,
Here is full log of install python-scipy:
File "1.py", line 3, in <module> from moviepy.video.tools.segmenting import findObjects File "/usr/local/lib/python2.7/dist-packages/moviepy/video/tools/segmenting.py", line 2, in <module> import scipy.ndimage as ndi ImportError: No module named scipy.ndimage deepak@deepakub16:~$ deepak@deepakub16:~$ sudo apt-get install python-scipy [sudo] password for deepak: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-image-4.4.0-21-generic linux-image-extra-4.4.0-21-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: binutils cpp-5 g++-5 gcc-5 gcc-5-base libasan2 libatomic1 libblas-common libblas3 libcc1-0 libcilkrts5 libgcc-5-dev libgfortran3 libgomp1 libitm1 liblapack3 liblsan0 libmpx0 libquadmath0 libstdc++-5-dev libstdc++6 libtsan0 libubsan0 python-decorator python-imaging python-numpy python-pil Suggested packages: binutils-doc gcc-5-locales g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-5-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg libstdc++-5-doc gfortran python-nose python-numpy-dbg python-numpy-doc python-pil-doc python-pil-dbg python-scipy-doc The following NEW packages will be installed: libblas-common libblas3 libgfortran3 liblapack3 python-decorator python-imaging python-numpy python-pil python-scipy The following packages will be upgraded: binutils cpp-5 g++-5 gcc-5 gcc-5-base libasan2 libatomic1 libcc1-0 libcilkrts5 libgcc-5-dev libgomp1 libitm1 liblsan0 libmpx0 libquadmath0 libstdc++-5-dev libstdc++6 libtsan0 libubsan0 19 upgraded, 9 newly installed, 0 to remove and 173 not upgraded. Need to get 45.3 MB of archives. After this operation, 57.0 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcc1-0 amd64 5.4.0-6ubuntu1~16.04.1 [38.8 kB] Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 binutils amd64 2.26.1-1ubuntu1~16.04.1 [2,308 kB] Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgomp1 amd64 5.4.0-6ubuntu1~16.04.1 [55.0 kB] Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libitm1 amd64 5.4.0-6ubuntu1~16.04.1 [27.5 kB] Get:5 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libatomic1 amd64 5.4.0-6ubuntu1~16.04.1 [8,886 B] Get:6 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libasan2 amd64 5.4.0-6ubuntu1~16.04.1 [264 kB] Get:7 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 liblsan0 amd64 5.4.0-6ubuntu1~16.04.1 [105 kB] Get:8 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libtsan0 amd64 5.4.0-6ubuntu1~16.04.1 [244 kB] Get:9 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libubsan0 amd64 5.4.0-6ubuntu1~16.04.1 [95.3 kB] Get:10 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcilkrts5 amd64 5.4.0-6ubuntu1~16.04.1 [40.1 kB] Get:11 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libmpx0 amd64 5.4.0-6ubuntu1~16.04.1 [9,760 B] Get:12 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libquadmath0 amd64 5.4.0-6ubuntu1~16.04.1 [131 kB] Get:13 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 g++-5 amd64 5.4.0-6ubuntu1~16.04.1 [8,432 kB] Get:14 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libstdc++-5-dev amd64 5.4.0-6ubuntu1~16.04.1 [1,429 kB] Get:15 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgcc-5-dev amd64 5.4.0-6ubuntu1~16.04.1 [2,231 kB] Get:16 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 gcc-5 amd64 5.4.0-6ubuntu1~16.04.1 [8,551 kB] Get:17 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 cpp-5 amd64 5.4.0-6ubuntu1~16.04.1 [7,786 kB] Get:18 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 gcc-5-base amd64 5.4.0-6ubuntu1~16.04.1 [16.6 kB] Get:19 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libstdc++6 amd64 5.4.0-6ubuntu1~16.04.1 [393 kB] Get:20 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libblas-common amd64 3.6.0-2ubuntu2 [5,342 B] Get:21 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libblas3 amd64 3.6.0-2ubuntu2 [147 kB] Get:22 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgfortran3 amd64 5.4.0-6ubuntu1~16.04.1 [260 kB] Get:23 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 liblapack3 amd64 3.6.0-2ubuntu2 [1,938 kB] Get:24 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 python-decorator all 4.0.6-1 [9,326 B] Get:25 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 python-pil amd64 3.1.2-0ubuntu1 [312 kB] Get:26 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 python-imaging all 3.1.2-0ubuntu1 [4,470 B] Get:27 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 python-numpy amd64 1:1.11.0-1ubuntu1 [1,763 kB] Get:28 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 python-scipy amd64 0.17.0-1 [8,733 kB] Fetched 45.3 MB in 3min 59s (189 kB/s) (Reading database ... 245431 files and directories currently installed.) Preparing to unpack .../libcc1-0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libcc1-0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../binutils_2.26.1-1ubuntu1~16.04.1_amd64.deb ... Unpacking binutils (2.26.1-1ubuntu1~16.04.1) over (2.26-8ubuntu2.1) ... Preparing to unpack .../libgomp1_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libgomp1:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libitm1_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libitm1:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libatomic1_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libatomic1:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libasan2_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libasan2:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../liblsan0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking liblsan0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libtsan0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libtsan0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libubsan0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libubsan0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libcilkrts5_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libcilkrts5:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libmpx0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libmpx0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libquadmath0_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libquadmath0:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../g++-5_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking g++-5 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libstdc++-5-dev_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libstdc++-5-dev:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../libgcc-5-dev_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libgcc-5-dev:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../gcc-5_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking gcc-5 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../cpp-5_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking cpp-5 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Preparing to unpack .../gcc-5-base_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking gcc-5-base:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Processing triggers for man-db (2.7.5-1) ... Setting up gcc-5-base:amd64 (5.4.0-6ubuntu1~16.04.1) ... (Reading database ... 245434 files and directories currently installed.) Preparing to unpack .../libstdc++6_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libstdc++6:amd64 (5.4.0-6ubuntu1~16.04.1) over (5.3.1-14ubuntu2.1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Setting up libstdc++6:amd64 (5.4.0-6ubuntu1~16.04.1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Selecting previously unselected package libblas-common. (Reading database ... 245434 files and directories currently installed.) Preparing to unpack .../libblas-common_3.6.0-2ubuntu2_amd64.deb ... Unpacking libblas-common (3.6.0-2ubuntu2) ... Selecting previously unselected package libblas3. Preparing to unpack .../libblas3_3.6.0-2ubuntu2_amd64.deb ... Unpacking libblas3 (3.6.0-2ubuntu2) ... Selecting previously unselected package libgfortran3:amd64. Preparing to unpack .../libgfortran3_5.4.0-6ubuntu1~16.04.1_amd64.deb ... Unpacking libgfortran3:amd64 (5.4.0-6ubuntu1~16.04.1) ... Selecting previously unselected package liblapack3. Preparing to unpack .../liblapack3_3.6.0-2ubuntu2_amd64.deb ... Unpacking liblapack3 (3.6.0-2ubuntu2) ... Selecting previously unselected package python-decorator. Preparing to unpack .../python-decorator_4.0.6-1_all.deb ... Unpacking python-decorator (4.0.6-1) ... Selecting previously unselected package python-pil:amd64. Preparing to unpack .../python-pil_3.1.2-0ubuntu1_amd64.deb ... Unpacking python-pil:amd64 (3.1.2-0ubuntu1) ... Selecting previously unselected package python-imaging. Preparing to unpack .../python-imaging_3.1.2-0ubuntu1_all.deb ... Unpacking python-imaging (3.1.2-0ubuntu1) ... Selecting previously unselected package python-numpy. Preparing to unpack .../python-numpy_1%3a1.11.0-1ubuntu1_amd64.deb ... Unpacking python-numpy (1:1.11.0-1ubuntu1) ... Selecting previously unselected package python-scipy. Preparing to unpack .../python-scipy_0.17.0-1_amd64.deb ... Unpacking python-scipy (0.17.0-1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Processing triggers for man-db (2.7.5-1) ... Setting up libcc1-0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up binutils (2.26.1-1ubuntu1~16.04.1) ... Setting up libgomp1:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libitm1:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libatomic1:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libasan2:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up liblsan0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libtsan0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libubsan0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libcilkrts5:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libmpx0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up libquadmath0:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up cpp-5 (5.4.0-6ubuntu1~16.04.1) ... Setting up libgcc-5-dev:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up gcc-5 (5.4.0-6ubuntu1~16.04.1) ... Setting up libstdc++-5-dev:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up g++-5 (5.4.0-6ubuntu1~16.04.1) ... Setting up libblas-common (3.6.0-2ubuntu2) ... Setting up libblas3 (3.6.0-2ubuntu2) ... update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode Setting up libgfortran3:amd64 (5.4.0-6ubuntu1~16.04.1) ... Setting up liblapack3 (3.6.0-2ubuntu2) ... update-alternatives: using /usr/lib/lapack/liblapack.so.3 to provide /usr/lib/liblapack.so.3 (liblapack.so.3) in auto mode Setting up python-decorator (4.0.6-1) ... Setting up python-pil:amd64 (3.1.2-0ubuntu1) ... Setting up python-imaging (3.1.2-0ubuntu1) ... Setting up python-numpy (1:1.11.0-1ubuntu1) ... Setting up python-scipy (0.17.0-1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ...
Thanks
Check following video:
Thanks
Ads