0

I installed PyQt4 using a file found here (Python 2.7, 32-bit). When I import PyQt4, I don't get an error, but when I try from PyQt4 import QtCore, I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name QtCore

When I try to list PyQt4's submodules (as described here), the only module listed is PyQt4 itself. Does anyone know what's going on?

jmcampbell
  • 378
  • 4
  • 17

1 Answers1

0

You can check where PyQt4 is being imported from (e.g. C:\Python27\lib\site-packages\PyQt4):

>>> import PyQt4
>>> PyQt4
<module 'PyQt4' from 'C:\Python27\lib\site-packages\PyQt4\__init__.pyc'>

and check if that directory contains the submodules (e.g. QtCore.pyd):

>>> from PyQt4 import QtCore
>>> QtCore
<module 'PyQt4.QtCore' from 'C:\Python27\lib\site-packages\PyQt4\QtCore.pyd'>

FWIW, my group has been getting PyQt from here: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11/PyQt4-4.11-gpl-Py2.7-Qt4.8.6-x32.exe

vedadev
  • 66
  • 5