Skip to content
Advertisement

Python 2.7 cannot import PyQt4

I’ve upgraded to Python 2.7 from Python 2.6 on Ubuntu Maverick Meerkat (10.10) and I’m unable to import PyQt4.

JavaScript

I installed both Python 2.7 (python2.7) and PyQt4 (python-qt4) from the Ubuntu repositories. I installed PyQt a while back, but I installed Python 2.7 recently.

If I try Python 2.6 (since it’s shipped with Ubuntu, the command is simply python), it works perfectly. Watch:

JavaScript

I know what the problem is: the PyQt4 modules are accessible by Python 2.6 but not 2.7. My question is, how do I get Python 2.7 to find the PyQt4 module(s)? Help!

Note: sorry if this belongs in Super User, I was just programming when I encountered this problem.

Advertisement

Answer

Under Ubuntu system, you could install it via apt-get

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement