[PyQt] Python 3.1 and problems importing QtCore

Phil Thompson phil at riverbankcomputing.com
Thu Jul 9 09:13:38 BST 2009


On Thu, 09 Jul 2009 00:16:01 +0200, gpuk <gpuk at dasserver.com> wrote:
> Hi list
> 
> First time poster and python/pyqt noob so please be gentle...
> 
> Platform: WinXP
> 
> I have Python 3.1 installed at "C:\Program Files\Python31"
> 
> I have downloaded and installed PyQt-Py3.0-gpl-4.5.1-1.exe (I
> encountered a warning during the install saying it couldn't locate
> Python 3.0 but I opted to continue).

Which is the cause of the problem.

> I have also downloaded and installed the MSVC2008 C++ runtime DLLs
> 
> Unfortunately, I cannot get any of the qtdemo's (located in "C:\Program
> Files\Python31\Lib\site-packages\PyQt4\examples\demos\qtdemo") to run.
> 
> Trying to execute any of the *.py scripts located in the demos folder 
> results in an error like the following:
> 
> ##############################
> C:\Program
> Files\Python31\Lib\site-packages\PyQt4\examples\demos\qtdemo>colors.p
> y
> Traceback (most recent call last):
>    File "C:\Program
> Files\Python31\Lib\site-packages\PyQt4\examples\demos\qtdemo\
> colors.py", line 3, in <module>
>      from PyQt4 import QtGui
> ImportError: DLL load failed: The specified module could not be found.
> ###############################

This is a standard, and misleading, message. It also means that the module
could be found but could not be imported.

> I have checked my system PATH and both "C:\Program
> Files\Python31\Lib\site-packages\PyQt4" and "C:\Program Files\Python31"
> are included. Typing "python" in a command window brings up the python
> interpreter as one would expect.
> 
> I have checked the FAQs and searched the mailing list but apart from
> advice to do with setting the PATH variable I can't find any
> hints/solutions. Also, I'm not entirely sure if PyQt supports Python 3.1
> yet (it's not very clear as to whether it supports Python 3 and later or
> only Python 3.0).

It supports both at the source level but the binary installer is for v3.0
and not v3.1.

> Apologies if I'm being stupid!

Your choices are...

- use Python v3.0.x for now

- compile PyQt yourself for v3.1

- wait until an installer for v3.1 is released.

Phil


More information about the PyQt mailing list