关于打包[ubuntu]
pyinstaller ctpbee_desktop.py #生成 ctpbee_desktop.spec build dist
修改 ctpbee_desktop.spec
# ctpbee_desktop.spec
datas=[("app/static","static"),
("venv/lib/python3.7/site-packages/ctpbee-0.31.3-py3.7-linux-x86_64.egg/ctpbee",'ctpbee'),("venv/lib/python3.7/site-packages/PySide2","PySide2")],
# datas=[("文件或文件夹路径:自行查找","dist下的名称")]
hiddenimports=['PySide2.QtPrintSupport'],
#可能需要显示导入QtPrintSupport,不过代码中貌似没出现使用的地方
再次打包
pyinstaller ctpbee_desktop.spec # 注意后缀 .spec
运行
cd dist/ctpbee_desktop
./ctpbee_desktop
打包时报错 No module named 'win32com'
pip install pypiwin32
如k线图不显示(QWebEngineView)