Jupyter Lab - 当我使用 jupyter lab 面板时如何更改为 UTF-8?

问题描述 投票:0回答:1

当我尝试在 jupyter lab 中使用面板时,它显示错误,我该如何解决? (除了更改操作系统语言)

[E 2024-04-04 11:39:28.809 ServerApp] Uncaught exception GET /panel-preview/render/ch06.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/panel-preview/render/ch06.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "E:\ProgramFile\python311\Lib\site-packages\tornado\web.py", line 1790, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "E:\ProgramFile\python311\Lib\site-packages\panel\io\jupyter_server_extension.py", line 247, in get
        nb = json.load(f)
             ^^^^^^^^^^^^
      File "E:\ProgramFile\python311\Lib\json\__init__.py", line 293, in load
        return loads(fp.read(),
                     ^^^^^^^^^
    UnicodeDecodeError: 'cp950' codec can't decode byte 0xc3 in position 8713: illegal multibyte sequence

https://live.staticflickr.com/65535/53629775482_795929816a_o.png

预期结果: 应显示面板。

python panel jupyter-lab
1个回答
0
投票

在我的电脑中设置环境变量“PYTHONIOENCODING=utf-8”后,重新启动,我现在可以使用面板了

© www.soinside.com 2019 - 2024. All rights reserved.