Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyQt 4.7 - ImportError after installing on Windows

I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui.

ImportError: DLL load failed: The specified module could not be found.

I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.

I can't run any of the examples, but the Designer, Assistant and Linguist run fine.

I am using ActivePython 3.1, if that makes any difference. And I haven't had any previous version of PyQt installed.


Edit:

I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.

like image 942
Reshure Avatar asked Jan 26 '10 16:01

Reshure


3 Answers

Are you sure there is a \bin directory for your version of PyQt? I am running PyQt 4.4, and all my binaries are right in:

C:\Python31\Lib\site-packages\PyQt4

Which is what I have my path pointing too. It sounds like PyQt4 was installed improperly... did you run this?

python setup.py install

There shouldn't be a bin there...

like image 194
Jason Coon Avatar answered Oct 06 '22 22:10

Jason Coon


Just wanted to chime in that I had the same problem on a WinXP install of:

  • python 2.7
  • Qt 4.7.1 (10.05)
  • PyQt 4.8.1

I used the windows installer version of all 3 of those items.

Copying the contents of the C:\Python27\Lib\site-packages\PyQt4\bin folder up to the main PyQt folder (C:\Python27\Lib\site-packages\PyQt4) stopped the 'dll not found' errors that python was throwing.

like image 44
mark Avatar answered Oct 06 '22 21:10

mark


Also chiming in. I installed both python 2.6 and PyQt 4.8.3 on a Windows 7 machine using the windows installers (I did NOT run 'python setup.py install').

I tried to run spyder (which requires PyQt 4.4 or greater) and failed because it couldn't find the PyQt .dlls. I copied all the .dlls from the \Lib\site-packages\PyQt4\bin folder to the \Lib\site-packages\PyQt4 folder, and spyder launches just fine.

like image 1
tudor Avatar answered Oct 06 '22 22:10

tudor