user583088
user583088

Reputation: 1085

Import error No module named skimage

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

Upvotes: 97

Views: 387090

Answers (13)

ishandutta2007
ishandutta2007

Reputation: 18214

I already had scikit-image but was still getting it,

I need to update:

python -m pip install -U scikit-image

Upvotes: 0

toktam
toktam

Reputation: 11

It seems that skimage library is not installed on your python environment. Therefore, it is suggested to run the following command in the command prompt or python terminal or a code cell in jupyter notebook:

pip install scikit-image

Ofcourse, you should be online that PyPI repository be available for you.

Upvotes: 1

the_redburn
the_redburn

Reputation: 143

On Debian based distributions:

sudo apt-get install python3-skimage

and, if you use it for python 2 scripts:

sudo apt-get install python-skimage

Upvotes: 2

Awais Imran
Awais Imran

Reputation: 99

You need to Activate your environment : E.g, .\Env Folder\Script\ac

Then:

python -m pip install scikit-image

Upvotes: 9

Vishvajeet Ramanuj
Vishvajeet Ramanuj

Reputation: 349

I tried using:

pip install scikit-image

It shows successful installation but when I import skimage it still gives me NoModuleFoundError.

This command worked for me:

python -m pip install -U scikit-image

Upvotes: 3

user15902817
user15902817

Reputation: 51

pip installation did not work for me. I solved the problem by trying

conda install scikit-image

For further information about installing scikit-image, visit the site - https://scikit-image.org/docs/dev/install.html

Upvotes: 4

Nick13
Nick13

Reputation: 59

OSX python3

Just run this code in your terminal:

sudo pip3 install scikit-image

If you faced any other issues please check this link for more.

Upvotes: 5

Jamil Hasnine Tamim
Jamil Hasnine Tamim

Reputation: 4448

Hey this is pretty simple to solve this error.Just follow this steps:

First uninstall any existing installation:

pip uninstall scikit-image

or, on conda-based systems:

conda uninstall scikit-image

Now, clone scikit-image on your local computer, and install:

git clone https://github.com/scikit-image/scikit-image.git
cd scikit-image
pip install -e .

To update the installation:

git pull  # Grab latest source
pip install -e .  # Reinstall

For other os and manual process please check this Link.

Upvotes: 0

Neela
Neela

Reputation: 107

For Python 3, try the following:

import sys
!conda install --yes --prefix {sys.prefix} scikit-image

Upvotes: 4

Shan Ali
Shan Ali

Reputation: 564

For python 3.5 in case you have multiple python versions and want to install with python3.5:

pip3 install scikit-image --user

Upvotes: 3

natcomp256
natcomp256

Reputation: 706

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.

Upvotes: 27

Joseph
Joseph

Reputation: 2567

You can use pip install scikit-image.

Also see the recommended procedure.

Upvotes: 183

venna
venna

Reputation: 71

For OSX: pip install scikit-image

and then run python to try following

from skimage.feature import corner_harris, corner_peaks

Upvotes: 6

Related Questions