Scribus Forums

Scribus => Scripts and Plugins => Topic started by: mielot on March 05, 2012, 01:37:55 pm

Title: PyQt4 import failure
Post by: mielot on March 05, 2012, 01:37:55 pm

I'm trying to import PyQt4 - but get a 'no module named' error.
I can vouch that PyQt4 is definitely installed though.

Any ideas?

Kindest regards

Title: Re: PyQt4 import failure
Post by: Astroman Pete on June 18, 2012, 09:46:54 pm
This thread is a bit stale, but a reply might help others.

I'm developing at work on a Windows machine where compiling Scribus and it's dependencies is impractical.
You must have Python bindings that reference the same version of Qt that Scribus is compiled against. You can find the Qt version under "Help > About Qt" in the pull-down menus.
What worked for me, was to then install the PySide bindings with the same Qt version number from (

Your QT bindings then need to be on your Python path. For me I had to:
Code: [Select]
import sys
from PySide import QtCore, QtGui

You must run your script as an extension script, also, or Scribus will freeze at this point.

My reasoning for using PySide and not PyQt4 are:
1. More permissive licensing.
2. I couldn't find older binaries for PyQt4. On non-Windows platforms, it may be more practical to compile Scribus against the version of Qt your PyQt4 uses.
Title: Re: PyQt4 import failure
Post by: a.l.e on June 19, 2012, 08:56:50 pm
getting pyqt to work with the (older) scripter (in 1.4) is not trivial. but possible.

it will be much easier with 1.6 (and the new scripter)