简体   繁体   English

导入PyQt4模块

[英]importing PyQt4 modules

I am not completely new to PyQt4, had it running before, but now (after update to Mac OSX.6) and reinstalling PyQt4 (4.9 with sip-4.13.1) every program that imports anything specific from PyQt4 quits with the error message: 我不是PyQt4的新手,以前运行过它,但是现在(更新到Mac OSX.6之后)并重新安装PyQt4(4.9和sip-4.13.1),每个从PyQt4导入特定内容的程序都会退出,并显示错误消息:

Traceback (most recent call last):
  File "helloQt.py", line 6, in <module>
    from PyQt4.QtGui import QApplication, QLabel
ImportError: No module named QtGui

The strange thing is also that the Python.Framework contains static libraries for QtCore.a, but only a trivial __init__.py that does not specify what to load. 奇怪的是,Python.Framework包含用于QtCore.a的静态库,但仅包含一个琐碎的__init__.py ,没有指定要加载的内容。

Thanks for suggestions melli79 感谢您的建议melli79

You can try: 你可以试试:

from PyQt4 import QtGui

which should work. 这应该工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM