[PyQt] ImportError: no module name PyQt4 (Windows 7, 64 bit)

John McCabe john at assen.demon.co.uk
Mon Aug 9 17:01:36 BST 2010

  On 09/08/2010 16:40, Hans-Peter Jansen wrote:
> Hi John,
> I've no idea, why you're dragging this thread into a private discussion.
Ooops - sorry about that. That was never my intention; it's a long time 
since I've joined a mailing list that has the default reply address for 
messages distributed set to "poster" rather than "the list" so I hadn't 
thought to check the "To:" field was set correctly!

> On Monday 09 August 2010, 15:01:12 John McCabe wrote:
>>    On 09/08/2010 12:44, Hans-Peter Jansen wrote:
>>> On Monday 09 August 2010, 12:41:31 John McCabe wrote:
>>>>     Hi
>>>> I've just installed PyQt4 with SIP on my PC and I'm getting the error
>>>> "ImportError: no module name PyQt4" when I try to run the qtdemo.pyw
>>>> file in the examples folder (see below).
>>> Please define "installed".
>> Fair point! Essentially I followed the suggestions at:
>> http://blog.oak-tree.us/index.php/2009/05/12/pyqt-windows/comment-page-1#
>> comment-855
>> except that I already had Qt/MinGW installed so skipped that bit, and
>> also extracted the zips in to c:\PyQt instead of within the Qt folder
>> structure.
>>>> My first thought was that my PYTHONPATH needed something adding to it,
>>>> but I'm fairly new to python and wasn't sure what to put in. I tried
>>>> adding the C:\Python24\Lib\site-packages folder, and the
>>>> C:\Python24\Lib\site-packages\PyQt4 one, but that didn't help.
>>> If you're so new to Python, why do you use such an old Python?
>> Well, i'm trying to get it going on a PC that already has Python 2.4
>> installed and, as the PyQt website explicitly says it works with Python
> Given that Python 2.4 predates Win7 by a fair bit, this looks strange, but anyway, it's your decision.
>>   >= 2.3, I didn't see that as an issue.
>>   >
>>>> Any other suggestions would be gratefully received.
>>> It's hard to do, since your message is lacking all those gory
>>> details... See, only due to your path presentation, we know, that you
>>> must use some form of Windows derivate, might it be Win 3.11 or maybe
>>> IBM OS/2 or even Atari TOS?
>> Well, given that the subject line is:
>> " [PyQt] ImportError: no module name PyQt4 (Windows 7, 64 bit)"
>> I assumed it would be quite obvious what Windows derivative I'm using :-}
> I missed that detail, sorry. Darren pointed out an important detail:
> you might suffer from 32/64 bit issues.

Yes - there was always that possibility. Can't see why though in this 
case as everything, Qt, Python24, MinGW etc is 32 bit just running on 
the 64 bit system.
> I suggest, you start over from the beginning: Note, that the article doesn't
> even mention 64 bit environments. Use the current versions of any part (you
> might resort to Python 2.6/2.7 rather than to 3.*), and try to check the
> outcome of each step.

Thanks for that suggestion. FWIW though, I've now downloaded and 
installed using the Python 2.4 version installer from the PyQt site and 
it seems to work ok.

More information about the PyQt mailing list