0

I don't have jpg support in my Qt installation in python. How can I install additional libraries for JPG support?

from PyQt4 import QtGui
import sys
app = QtGui.QApplication(sys.argv)
QtGui.QImageReader.supportedImageFormats()

Out[5]: 
[PyQt4.QtCore.QByteArray('bmp'),
 PyQt4.QtCore.QByteArray('pbm'),
 PyQt4.QtCore.QByteArray('pgm'),
 PyQt4.QtCore.QByteArray('png'),
 PyQt4.QtCore.QByteArray('ppm'),
 PyQt4.QtCore.QByteArray('xbm'),
 PyQt4.QtCore.QByteArray('xpm')]
nisarg parekh
  • 413
  • 4
  • 23
Oli
  • 1,313
  • 14
  • 31
  • The solution in these links doesn't help unfortunatelly. – Oli Jun 07 '19 at 09:34
  • 1
    I think you can use `QtCore.QCoreApplication.addLibraryPath('plugins')`and it is duplicate even if this is the right answer. – Haru Jun 07 '19 at 11:04

1 Answers1

1

Well, The problem is solved by doing two things.

  1. creating/moving qt.conf file in folder where we have python.exe

  2. putting following items in the qt.conf file

[Paths] 
Prefix = C:/Python27_64/Library 
Binaries = C:/Python27_64/Library/bin 
Libraries = C:/Python27_64/Library/lib 
Headers = C:/Python27_64/Library/include/qt 
Plugins = C:/Python27_64/Library/plugins
  1. Make sure following paths are accessible.

If there is already qt.conf file available, then move it to directory where the you have python.exe file. Then append following at the end. Plugins = C:/Python27_64/Library/plugins

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Oli
  • 1,313
  • 14
  • 31