ImportError: No module named PyQt4 on my Raspberry Pi

I've got PyQt4 and pyqt4-dev-tools installed on my raspberry pi but I'm getting

ImportError: No module named PyQt4 on my Raspberry Pi

with the following includes when I run python3

from PyQt4 import QtGui

from PyQt4 import QtCore

I've got another Pi that PyQT4 is found so I'm not sure what I've done wrong on this one. Can anyone tell me what I can do to get Python to find the PyQt4 modules?


Most likely you installed PyQt4 and pyqt4-dev-tools for Python 2.x, but not for Python 3.x.

Check if PyQt4 is in your site-packages directory for Python 3.x. For me this is under /usr/lib/python3.4/site-packages/PyQt4 .

If it's not there, you need to grab the correct Python 3 version of the packages. What distro are you using?

链接地址: http://www.djcxy.com/p/65022.html

上一篇: 如果调用另一个函数,则不会加载TkInter框架

下一篇: ImportError:我的Raspberry Pi没有名为PyQt4的模块