Search code examples
pythonimage-processingcomputer-visionscikit-image

skimage.color.rgb2gray import trouble


I am having problem with importing skimage.color module. Although I can import and call skimage.color.rgb2gray from python shell, I cannot do the same thing from my application.

I checked skimage lib places on my PC. They all seems to be fine. But when I try to call skimage.color. from my code it always gives me this

Traceback (most recent call last):
File "main-video2.py", line 44, in <module>
image = color.rgb2gray(image)

I checked the module like this

username@ubuntu:~/dev/computer_vision$ python 
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 
 KeyboardInterrupt
 >>> from skimage import color 
 >>> color 
 <module 'skimage.color' from '/usr/local/lib/python2.7/dist-packages/skimage/color/__init__.pyc'>

Anybody can help me to understand why would be the reason while I'm able to call it from shell but not from my code ?


Solution

  • I think you do not have the other libraries installed on your PC. Check THIS PAGE and verify whether you have the required libraries required for runtime applications.

    The reason for this error is because although skimage package may be present and available (in python shell) you will not be able to run any application without the support of the other mentioned packages like : matplotlib, scipy, pil, numpy and six.

    Visit the link to install/update the required packages.

    Leave a comment if you still have a problem. :)