3

I am currently using a Windows XP machine (32 bit). I am new to Scribus, and have enjoyed using it over the other expensive program for desktop publishing. In Scribus I have a prewritten script I would like to run. The beginning of the script contains:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from PyQt4.QtCore import *
from PyQt4.QtGui import *

class DockDialog(QDockWidget):

I have installed Python 3.2 via ActivePython (after trying to install from python.org). After the install I then opened a DOS window and typed pypm install pyqt4, which, as far as I could tell installed properly. I then tried to run the script in Scribus and received the following message:

Traceback (most recent call last):
  File "<string>", line 8, in ?
  File "C:/Program Files/Scribus 1.3.3.14/share/scripts/Scribus-DockWidgets/DockWidgets.py", line 4, in ?
    from PyQt4.QtCore import *
ImportError: No module named PyQt4.QtCore

I then tried reinstalling PYQT4, by typing what I had before, and I was told that PYQT4 was already installed via:

skipping "pyqt4" already installed at "%APPDATA%\Python" (3.2)

After looking in c:\Python32 in all of the directories I can not find any PYQT files. Where were they installed? How do I make sure that script is able to fing the PYQT4 files necessary to run?

My PATH variable is:

C:\Python32\;C:\Python32\Scripts;

Ultimately I would like help in getting the scribus script to work.

Thank you for your help!

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
Brian
  • 31
  • 3

1 Answers1

2

Type this command to see where PyQt is installed:

pypm files --full-path pyqt4

By default, PyPM installs packages into your %APPDATA%\Python directory. If you want to install globally into C:\Python32 use the -g option (like: pypm -g install pyqt4)

How do I make sure that script is able to fing the PYQT4 files necessary to run

Are you sure that you are invoking Python 3.2? Try running pypm -g install pyqt4 if all else fails.

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
  • Thank you for the quick reply. I did as you suggested for the global install (however I did not uninstall the %APPDATA% install) When I run --full-path I get a list for %APPDATA% not c:\Python32\sip\pyqt4 where I now also see files. In the end I still try to run the script in Scribus, and still receive the same error message as before "No Module named pyqt4.QTCore. The scripts I am trying to run can be found here: http://blog.oak-tree.us/index.php/2010/08/25/scribus-dockwidgets The Dock Widget script – Brian Apr 16 '11 at 06:06
  • @Brian - For listing files in the *global* install, you need to run `pypm -g files --full-path pyqt4`. Try adding `import sys; print(sys.path)` above the `import PyQt4.QtCore` line and report back what you see being printed. – Sridhar Ratnakumar Apr 16 '11 at 17:07