在Ubuntu上PyQt程序启动非常慢

时间:2012-04-08 02:06:04

标签: ubuntu pyqt

当我在Terminal中运行以下PyQt代码示例时:

#coding = utf8
import sys
from PyQt4 import QtGui

app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.resize(250, 150)
widget.setWindowTitle('simple')
widget.show()
sys.exit(app.exec_())

我收到以下消息:

Got bus address:  "unix:abstract=/tmp/dbus-i0C7rhmhFB,guid=6b91faa5b449dbb3ca941d6e0000001d" 
Connected to accessibility bus at:  "unix:abstract=/tmp/dbus-i0C7rhmhFB,guid=6b91faa5b449dbb3ca941d6e0000001d" 
Registered DEC:  true 
Error in contacting registry 
"org.freedesktop.DBus.Error.NoReply" 
"Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." 
Could not query active accessibility event listeners. 
Registered event listener change listener:  true 

大约20秒后窗口显示。我认为显示一个空窗口应该很快。如何解决这个问题?

以下是版本信息:

  • ubuntu 12.04 LTS 64bit
  • Python 2.7.3rc2
  • QT 4.8.0& PyQT 4.9.1

1 个答案:

答案 0 :(得分:1)

在我的机器上,代码立即运行 - Kubuntu 11.10,KDE 4.8.2

我认为问题可能出在您的环境配置中,尤其是当您运行未发布的版本时 - Ubuntu 12.04。