PyQt4无法导入Qsci

nmi*_*els 3 python linux qt pyqt qscintilla

我正在旧的Linux系统(CentOS 4.4)上安装PyQt4,由于硬件兼容性原因无法升级.我安装了Python 2.6,QT4和SIP,并且PyQt4的安装没有给我任何错误.

当我运行Python时,会发生这种情况:

Python 2.6.2 (r262:71600, May 11 2011, 14:18:37) 
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
>>> import PyQt4.Qsci
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Qsci
Run Code Online (Sandbox Code Playgroud)

我环顾四周,发现/usr/local/lib/python2.6/site-packages/PyQt4/uic/widget-plugins/qscintilla.py,几乎没有评论的东西:

pluginType = MODULE

def moduleInformation():
    return "PyQt4.Qsci", ("QsciScintilla", )
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

小智 6

您需要单独安装qscintilla.如果已经安装了PyQt,那么你应该只需要安装qscintilla python绑定.希望这可以解决您的问题!

  • 您链接的页面没有下载链接,[QScintilla2的来源可以在这里下载](http://www.riverbankcomputing.co.uk/software/qscintilla/download) (2认同)