简体   繁体   English

PyQt4无法导入Qsci

[英]PyQt4 can't import Qsci

I'm installing PyQt4 on an old Linux system (CentOS 4.4) that can't be upgraded for hardware compatibility reasons. 我正在旧的Linux系统(CentOS 4.4)上安装PyQt4,由于硬件兼容性原因无法升级。 I've got Python 2.6, QT4 and SIP installed, and the installation of PyQt4 didn't give me any errors. 我安装了Python 2.6,QT4和SIP,并且PyQt4的安装没有给我任何错误。

When I run Python, this happens: 当我运行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

I looked around, and found /usr/local/lib/python2.6/site-packages/PyQt4/uic/widget-plugins/qscintilla.py , which is almost empty of non-comment stuff: 我环顾四周,找到了/usr/local/lib/python2.6/site-packages/PyQt4/uic/widget-plugins/qscintilla.py ,这几乎是空的非评论内容:

pluginType = MODULE

def moduleInformation():
    return "PyQt4.Qsci", ("QsciScintilla", )

Any ideas? 有任何想法吗?

You need to install qscintilla separately. 您需要单独安装qscintilla If PyQt is already installed, then you should just have to install the qscintilla python bindings. 如果已经安装了PyQt,那么你应该只需要安装qscintilla python绑定。 Hopefully this fixes your issue! 希望这可以解决您的问题!

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

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