Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import PyQt4.QtGui

Tags:

python

qt

pyqt4

I have a working Python 2.6 install and just installed the PyQt4 built for Python 2.6 (available at http://www.riverbankcomputing.co.uk/software/pyqt/download). When I try to import PyQt4.QtGui I get the following error:

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

I'm on Windows 2k8 64-bit, but my Python install is 32-bit.

like image 787
Rock Hymas Avatar asked Apr 29 '10 16:04

Rock Hymas


2 Answers

Add the the PyQt4 directory containing Qt's applications and DLLs to your PATH environment variable. In PowerShell, provided you didn't change any of your install paths, that'd be

$env:path += ';C:\Python26\Lib\site-packages\PyQt4\bin'
like image 114
Benjamin Pollack Avatar answered Oct 02 '22 08:10

Benjamin Pollack


I found a solution on another forum that worked for me. I needed to copy QtGui4.dll and QtCore4.dll into the ...\Python2.7.1\Lib\site-packages\PyQt4 directory. Note, I left the original in the bin directory.

like image 24
frustatedFriend Avatar answered Oct 02 '22 08:10

frustatedFriend