在WSL2.0环境里执行python3 main.py,界面出现乱码
🐛 Bug Description
PYTHONIOENCODING=utf-8 python3 main.py
指定了python coding 执行main.py,运行后出现问题。 libEGL warning: failed to open /dev/dri/renderD128: Permission denied
/bin/sh: 1: python: not found 2024-09-12 23:16:15,235 - DEBUG - panel_zhiku.py:84 init_ui: 【华泰金工】多因子10:因子合成方法实证分析20190104.pdf 2024-09-12 23:16:15,378 - DEBUG - panel_backtest.py:210 add_stock_para_lay: select_code: 399006.SZ 2024-09-12 23:16:15,381 - DEBUG - panel_backtest.py:368 add_backt_para_lay: select_benchmark: 000300.SH 2024-09-12 23:16:15,384 - DEBUG - panel_backtest.py:470 add_backt_para_lay: select_strategy: 单因子-相对强弱指数RSI Gdk-Message: 23:16:15.409: Unable to load sb_h_double_arrow from the cursor theme Gdk-Message: 23:16:15.418: Unable to load sb_v_double_arrow from the cursor theme Gdk-Message: 23:16:15.418: Unable to load sb_h_double_arrow from the cursor theme 2024-09-12 23:16:15,448 - DEBUG - panel_sim_trade.py:233 add_trade_para_layer: select_trade_type: 股票 2024-09-12 23:16:15,448 - DEBUG - panel_sim_trade.py:249 add_trade_para_layer: select_code: 600519.SH 2024-09-12 23:16:15,449 - DEBUG - panel_sim_trade.py:275 add_trade_para_layer: select_trade_platform: 东方财富 2024-09-12 23:16:15,450 - DEBUG - panel_sim_trade.py:300 add_trade_para_layer: [虚拟盘] select_trade_strategy: 单因子-相对强弱指数RSI $$$$$$$$$$$$
股票 虚拟盘
2024-09-12 23:16:15,451 - INFO - panel_sim_trade.py:464 show_trade_boardview: SimTradeWebPanel - https://sim.myquant.cn/sim?acc=5e4cdda3-f2fb-11ed-ae27-00163e022aa6 Gdk-Message: 23:16:15.463: Unable to load sb_h_double_arrow from the cursor theme Gdk-Message: 23:16:15.465: Unable to load sb_v_double_arrow from the cursor theme Gdk-Message: 23:16:15.465: Unable to load sb_h_double_arrow from the cursor theme 2024-09-12 23:16:15,498 - DEBUG - panel_real_trade.py:235 add_trade_para_layer: select_trade_type: 股票 2024-09-12 23:16:15,498 - DEBUG - panel_real_trade.py:251 add_trade_para_layer: select_code: 600519.SH 2024-09-12 23:16:15,499 - DEBUG - panel_real_trade.py:277 add_trade_para_layer: select_trade_platform: 东方财富 2024-09-12 23:16:15,500 - DEBUG - panel_real_trade.py:302 add_trade_para_layer: [实盘] select_trade_strategy: 单因子-相对强弱指数RSI $$$$$$$$$$$$
股票 实盘
2024-09-12 23:16:15,501 - INFO - panel_real_trade.py:465 show_trade_boardview: RealTradeWebPanel - https://sim.myquant.cn/sim?acc=5e4cdda3-f2fb-11ed-ae27-00163e022aa6
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content width -33 (allocation 1, extents 17x17) while allocating gadget (node button, owner GtkButton)
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content height -9 (allocation 1, extents 5x5) while allocating gadget (node button, owner GtkButton)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content width -5 (allocation 13, extents 9x9) while allocating gadget (node entry, owner GtkEntry)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.515: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.515: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node header, owner GtkNotebook)
(main.py:42359): Gtk-CRITICAL **: 23:16:15.516: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -9 (allocation 9, extents 9x9) while allocating gadget (node entry, owner GtkEntry)
(main.py:42359): Gtk-WARNING **: 23:16:15.516: Negative content width -9 (allocation 9, extents 9x9) while allocating gadget (node entry, owner GtkEntry) libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
Segmentation fault
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Screenshot
Environment
Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.
- Qbot version:
- Python version: 3.12
- OS (
Windows,Linux,MacOS): WSL on Win11 - Commit number (optional, please provide it if you are using the dev version): https://github.com/UFund-Me/Qbot/commit/c09ccf49cecd7506922c4f79c6aa27608d41087d
Additional Notes
俺也一样,因为服务器没有显示器,用 MoTTY X11 proxy 可以在本地电脑打开界面,但是中文乱码
我也一样。乱码的形式也一样。win11 + wsl2 + ubuntu22.04
我也一样。乱码的形式也一样。win11 + wsl2 + ubuntu22.04
解决了,把windows下的字体复制过去就好了
sudo mkdir -p /usr/share/fonts/windows11
sudo cp /mnt/c/Windows/Fonts/* /usr/share/fonts/windows11
https://juejin.cn/post/7320102376175501322
推荐:
- windows11 + power shell 终端 + python 3.9/3.8;
- macos + iterm2 + python3.9/3.8;
- ubuntu + Terminal / 终端 + python 3.9/3.8 ;
如果还有问题,可以直接call我,微信 Yida_Zhang2