Jupyter Notebook 无法与 WSL 一起使用

Jupyter Notebook 无法与 WSL 一起使用

我在 Windows 电脑上安装了 Windows Subsystem for Linux 2,并使用 Ubuntu 访问 Jupyter Notebook。现在它停止工作了。当我打开 Ubuntu 并输入时,它jupyter notebook会给我一个链接,我将其复制到 Microsoft Edge 中。我现在收到以下错误消息。

kathmcp02@DESKTOP-Q2SS990:~$ jupyter notebook
Traceback (most recent call last):
  File "/home/kathmcp02/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/home/kathmcp02/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 44, in <module>
    from jinja2 import Environment, FileSystemLoader
ImportError: cannot import name 'Environment' from 'jinja2' (/home/kathmcp02/.local/lib/python3.8/site-packages/jinja2/__init__.py)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
    import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
  File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 4, in <module>
    from .adapters import UnixAdapter
  File "/usr/lib/python3/dist-packages/requests_unixsocket/adapters.py", line 3, in <module>
    from requests.adapters import HTTPAdapter
ImportError: cannot import name 'HTTPAdapter' from 'requests.adapters' (/home/kathmcp02/.local/lib/python3.8/site-packages/requests/adapters.py)

Original exception was:
Traceback (most recent call last):
  File "/home/kathmcp02/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/home/kathmcp02/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 44, in <module>
    from jinja2 import Environment, FileSystemLoader
ImportError: cannot import name 'Environment' from 'jinja2' (/home/kathmcp02/.local/lib/python3.8/site-packages/jinja2/__init__.py)

我不太懂电脑,所以任何帮助我都会非常感激。谢谢!

相关内容