ModuleNotFoundError: No module named ‘skimage’ in Python

Are you facing the error “no module named skimage“? Yes, you have come to the right place. Today in this tutorial, I will show you how to resolve this error.

This error “no module named ‘skimage’” occurs when you forget to install “scikit-image” before importing it or installing it in the wrong environment.

[Solution] modulenotfounderror: no module named skimage

To solve this error, you need to install the scikit-image Python package using the pip install scikit-image command.

[Fixed]: AttributeError: ‘str’ object has no attribute ‘contains’

Here is the command to install scikit-image on your system:

# If you are in a virtual environment or using Python 2
pip install scikit-image 

# For python 3, could also be pip3.10
pip3 install scikit-image 

# If you get permissions error you can run command as admin
sudo pip3 install beautifulsoup4
pip install scikit-image --user

# If you don't have pip in your PATH environment variable
python -m pip install scikit-image 

# For python 3 if you don't have pip in your PATH environment variable
python3 -m pip install scikit-image 

# Using py alias (Only works for Windows)
py -m pip install scikit-image 

# Alternative for Ubuntu/Debian
sudo apt-get install python3-scikit-image 

# If you are coidng with Anaconda
conda install -c anaconda scikit-image 

# If you are using Jupyter Notebook
!pip install scikit-image 

When you successfully install skimage, you can import it like this:

import skimage

print(skimage.__version__)

The Python error “modulenotfounderror no module named ‘skimage’” can occur for multiple reasons:

  1. Not having scikit-image package installed. If you have not installed the skimage package then you can install it with this command “pip install scikit-image “.
  2. Installing the scikit-image package in a different python version than you are using.
  3. Installing the package in the global environment when you are using the virtual environment.
  4. You are using the incorrect version of python on your IDE. (e.g. VS Code)
  5. Using the file name “skimage.py“. If you are using a name like this skimage.py then consider it changing to something else.
  6. Declaring a variable with the name “skimage“. If you have a variable skimage change its name to something else.

Conclusion on modulenotfounderror: no module named skimage

Programmers, we discussed the Python error “modulenotfounderror no module named ‘skimage’“. I hope you have solved your Python error. If you have any questions about the tutorial or are still facing the error, please let us know in the comments section.

Leave a Reply