0

I am working on image for RGB color manipulation using Skimage and having below configuration of packages:

Python 3.6.1

scikit-image 0.13.0

pyqt 5.6.0

from skimage import io

import sip
sip.setapi('QString', 2)
from PyQt5 import QtGui

io.use_plugin('pil','imread')

img=io.imread('RpMkYUX.jpg')
io.use_plugin('qt' ,'imshow')
io.imshow(img)
io.show()

expecting output as in image

expected output

and i am getting below error as:

(C:\Users\rahul\Anaconda3) C:\Users\rahul\AnacondaProjects\15_PIL>python 2_.py
Traceback (most recent call last):
  File "C:\Users\rahul\Anaconda3\lib\site-packages\skimage\io\_plugins\qt_plugin.py", line 11, in <module>
    from PyQt4.QtGui import (QApplication, QImage,
ModuleNotFoundError: No module named 'PyQt4'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "2_.py", line 16, in <module>
    io.use_plugin('qt' ,'imshow')
  File "C:\Users\rahul\Anaconda3\lib\site-packages\skimage\io\manage_plugins.py", line 255, in use_plugin
    _load(name)
  File "C:\Users\rahul\Anaconda3\lib\site-packages\skimage\io\manage_plugins.py", line 299, in _load
    fromlist=[modname])
  File "C:\Users\rahul\Anaconda3\lib\site-packages\skimage\io\_plugins\qt_plugin.py", line 28, in <module>
    """)
ImportError:     PyQt4 libraries not installed. Please refer to

    http://www.riverbankcomputing.co.uk/software/pyqt/intro

    for more information.  PyQt4 is GPL licensed.  For an
    LGPL equivalent, see

    http://www.pyside.org
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • as I see skimage requires PyQt4, instead you have PyQt5 installed: pyqt 5.6.0, a possible solution is to install PyQt4. read this: https://stackoverflow.com/questions/21637922/how-to-install-pyqt4-in-anaconda – eyllanesc Dec 04 '17 at 19:44
  • I've added an issue to address the problem: https://github.com/scikit-image/scikit-image/issues/2912 – Stefan van der Walt Dec 04 '17 at 20:46

1 Answers1

0

I use pip 19.1.1 and Python 3.7.4

D:\tesF> python scikit-image-tes.py
Traceback (most recent call last):
  File "scikit-image-tes.py", line 10, in <module>
    io.use_plugin('qt' ,'imshow')
  File "C:\Users\pcname\AppData\Roaming\Python\Python37\site-packages\skimage\io\manage_plugins.py", line 254, in use_plugin
    _load(name)
  File "C:\Users\pcname\AppData\Roaming\Python\Python37\site-packages\skimage\io\manage_plugins.py", line 298, in _load
    fromlist=[modname])
  File "C:\Users\pcname\AppData\Roaming\Python\Python37\site-packages\skimage\io\_plugins\qt_plugin.py", line 5, in <module>
    from qtpy.QtWidgets import (QApplication, QLabel, QMainWindow, QWidget,
ModuleNotFoundError: No module named 'qtpy'

Before I've got error

Solved by:

D:\tesF> pip install sip
D:\tesF> pip install qtpy

before that, I've installed

D:\tesF> pip install PyQt5
Tim
  • 2,510
  • 1
  • 22
  • 26