Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import error No module named skimage

Tags:

scikit-image

I am building code on python using skimage. But I am getting import errors while using skimage.segmentation.

Traceback (most recent call last):

File "superpixel.py", line 5, in

from skimage.segmentation import slic

ImportError: No module named skimage.segmentation

like image 542
user583088 Avatar asked Jun 28 '16 22:06

user583088


People also ask

How do you solve a No module named Skimage?

The Python "ModuleNotFoundError: No module named 'skimage'" occurs when we forget to install the scikit-image module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install scikit-image command.


2 Answers

You can use pip install scikit-image.

Also see the recommended procedure.

like image 144
Joseph Avatar answered Sep 17 '22 16:09

Joseph


As per the official installation page of skimage (skimage Installation) : python-skimage package depends on matplotlib, scipy, pil, numpy and six.

So install them first using

sudo apt-get install python-matplotlib python-numpy python-pil python-scipy 

Apparently skimage is a part of Cython which in turn is a superset of python and hence you need to install Cython to be able to use skimage.

sudo apt-get install build-essential cython 

Now install skimage package using

sudo apt-get install python-skimage 

This solved the Import error for me.

like image 39
rajiv_ Avatar answered Sep 20 '22 16:09

rajiv_