简体   繁体   中英

skimage is not defined in jupyter notebook despite having installed the module

I created a virtual environment and installed scikitimage but when i use jupyter notebook it says no modules named skimage.

I installed scikitimage without using virtual enviroment but still jupyter can't find it.

from skimage import color, io
    def load(image_path):

        out = image_path

        out = skimage.io.imread(image_path)
        pass


    image1 = load(image1_path)

NameError                                 Traceback (most recent call last)
<ipython-input-3-08b9c4b0aed1> in <module>
----> 1 image1 = load(image1_path)
      2 image2 = load(image2_path)
      3 
      4 display(image1)
      5 display(image2)

~\Suleman\imageOperations.py in load(image_path)
     21     ### YOUR CODE HERE
     22     # Use skimage io.imread
---> 23     out = skimage.io.imread(image_path)
     24     pass
     25     ### END YOUR CODE

NameError: name 'skimage' is not defined
  1. first of all you need to uninstall scikit-image .Then

  2. install it via shell/command prompt:

    pip install scikit-image

  3. If you are running Anaconda or miniconda, open anaconda prompt then run this

    conda install -c conda-forge scikit-image

  4. if these steps aren't working upgrade your pip using

    python -m pip install –upgrade pip

  5. then follow again from step 1 to 3 that I have mentioned

If these aren't work uninstall scikit-image from both pip and conda then try this in anaconda prompt

  1. conda config --add channels conda-forge
  2. conda install scikit-image
  3. conda search scikit-image --channel conda-forge
  1. Open CMD (the command prompt)
  2. Type pip install scikit-image in the CMD window
  3. Type py in the CMD window
  4. Type import skimage
  5. Go back to your Jupyter notebook for image processing issues

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM