![](/img/trans.png)
[英]PyQt4 QAbstractListModel - Only first data widget is displayed
[英]RuntimeError: qtutils is only compatible with version 2 of the PyQt4
我嘗試運行的程序正在anaconda環境中導入以下軟件包:
from PyQt4 import QtCore, QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
我按照此鏈接中的說明安裝了PyQt4
但是,安裝后出現以下錯誤:
RuntimeError: qtutils is only compatible with version 2 of the PyQt4 API.Whilst you can import PyQt4 prior to importing qtutils (in order to tell qtutils to use PyQt4), either set the API version to 2 yourself, or import qtutils (which will set it for you) prior to importing QtGui or QtCore.
該程序正在嘗試導入
from PyQt4 import QtCore, QtGui
from qtutils import inmain_later,inthread,inmain
你有什么建議嗎?
如錯誤消息所述,請在導入qtutils之后導入PyQt4。
Qtutils將PyQt4 sip API設置為版本2,這必須在導入PyQt4之前完成。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.