vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 2
声望: 1

ImportError: cannot import name 'Qsci' from 'PyQt5'

网上可能的解决方案如pip、sudo apt install 相关的包后,还是无法解决。

(贴图好像有点Bug,上传不上来

Administrator
avatar
加入于:
帖子: 2125
声望: 96

pip install QScintilla

注意大小写,如果报错的话请贴下报错输出

Member
avatar
加入于:
帖子: 2
声望: 1

都试过了,还是不行。
Traceback (most recent call last):
File "vn_trader_gui.py", line 5, in <module>
from vnpy.trader.ui import MainWindow, create_qapp
File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/vnpy/trader/ui/init.py", line 10, in <module>
from .mainwindow import MainWindow
File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/vnpy/trader/ui/mainwindow.py", line 27, in <module> t__.py)
from .editor import CodeEditor
File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/vnpy/trader/ui/editor.py", line 4, in <module>
from PyQt5 import QtWidgets, Qsci, QtGui

ImportError: cannot import name 'Qsci' from 'PyQt5' (/home/ubuntu/miniconda3/lib/python3.7/site-packages/PyQt5/init.py)

ps 陈大,论坛登录后,web各个按钮的icon都没有有了,而且传不了图。不知道是不是只有我这样?我换了电脑和网络都不行?

Administrator
avatar
加入于:
帖子: 2125
声望: 96

顶部浏览器,地址里前缀改为https://,然后回车刷新下就行。

我们发现新版的Chrome不知道为什么有时会跳到http协议

Administrator
avatar
加入于:
帖子: 2125
声望: 96

pip install QScintilla

装上这个新的库

Member
avatar
加入于:
帖子: 20
声望: 0

pip install QScintilla

Member
avatar
加入于:
帖子: 3
声望: 0

您好,解决了吗?
我在Mac上也遇到这个问题。
(使用上面的 pip install QScintilla命令也还是不行。

使用 python run.py 后的具体内容是:
$ python run.py
Traceback (most recent call last):
File "run.py", line 5, in <module>
from vnpy.trader.ui import MainWindow, create_qapp
File "/opt/anaconda3/lib/python3.7/site-packages/vnpy/trader/ui/init.py", line 10, in <module>
from .mainwindow import MainWindow
File "/opt/anaconda3/lib/python3.7/site-packages/vnpy/trader/ui/mainwindow.py", line 27, in <module>
from .editor import CodeEditor
File "/opt/anaconda3/lib/python3.7/site-packages/vnpy/trader/ui/editor.py", line 4, in <module>
from PyQt5 import QtWidgets, Qsci, QtGui
ImportError: cannot import name 'Qsci' from 'PyQt5' (/opt/anaconda3/lib/python3.7/site-packages/PyQt5/init.py)

使用pip install QScintilla显示我原本就已经有PyQt5了。(所以可以排除库的问题
$ pip install QScintilla
Requirement already satisfied: QScintilla in /opt/anaconda3/lib/python3.7/site-packages/QScintilla-2.11.3-py3.7-macosx-10.9-x86_64.egg (2.11.3)
Requirement already satisfied: PyQt5>=5.10.1 in /opt/anaconda3/lib/python3.7/site-packages (from QScintilla) (5.13.2)
Requirement already satisfied: PyQt5_sip<13,>=4.19.19 in /opt/anaconda3/lib/python3.7/site-packages (from PyQt5>=5.10.1->QScintilla) (12.7.0)

Member
avatar
加入于:
帖子: 4
声望: 0

pip install -U pyqt5
成功解决问题

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3