我使用jupyter-lab
和jupyter-notebook
之类的jupyter应用程序已经有一段时间了,没有任何问题,但是今天我注意到从命令行或命令行启动jupyter-lab
时出现内核问题。通过anaconda-navigator
(我已经安装了Anaconda with Python3.7 for Linux)。
当我尝试通过命令行启动jupyter-lab
时,收到以下错误消息(如果我尝试通过anaconda导航器调用jupyter-lab
也会弹出该错误消息:
[I 16:37:07.486 LabApp] JupyterLab extension loaded from /home/user/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 16:37:07.486 LabApp] JupyterLab application directory is /home/user/anaconda3/share/jupyter/lab
[W 16:37:07.487 LabApp] JupyterLab server extension not enabled, manually loading...
[I 16:37:07.488 LabApp] JupyterLab extension loaded from /home/user/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 16:37:07.488 LabApp] JupyterLab application directory is /home/user/anaconda3/share/jupyter/lab
[I 16:37:07.489 LabApp] Serving notebooks from local directory: /home/user
[I 16:37:07.489 LabApp] The Jupyter Notebook is running at:
[I 16:37:07.489 LabApp] http://localhost:8888/?token=b5912dbe9af5317da84389aaa05b8e96abd7e6402ec508ad
[I 16:37:07.489 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:37:07.503 LabApp]
To access the notebook, open this file in a browser:
file:///run/user/17930/jupyter/nbserver-17066-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=b5912dbe9af5317da84389aaa05b8e96abd7e6402ec508ad
[I 16:37:09.485 LabApp] Node v8.15.0
[I 16:37:09.620 LabApp] Build is up to date
[I 16:37:10.026 LabApp] Kernel started: 7cc817c2-a48b-40bf-9721-c3401175a0e9
Traceback (most recent call last):
File "/home/user/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/user/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/user/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py", line 15, in
from ipykernel import kernelapp as app
File "/home/user/anaconda3/lib/python3.7/site-packages/ipykernel/__init__.py", line 2, in
from .connect import *
File "/home/user/anaconda3/lib/python3.7/site-packages/ipykernel/connect.py", line 13, in
from IPython.core.profiledir import ProfileDir
File "/home/user/anaconda3/lib/python3.7/site-packages/IPython/__init__.py", line 54, in
from .core.application import Application
File "/home/user/anaconda3/lib/python3.7/site-packages/IPython/core/application.py", line 23, in
from traitlets.config.application import Application, catch_config_error
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/__init__.py", line 6, in
from .application import *
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 19, in
from traitlets.config.configurable import Configurable, SingletonConfigurable
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/configurable.py", line 12, in
from .loader import Config, LazyConfigValue, _is_section_key
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/loader.py", line 49, in
class ArgumentParser(argparse.ArgumentParser):
AttributeError: module 'argparse' has no attribute 'ArgumentParser'
(然后计算机尝试重新启动内核五次。在所有五次尝试重新启动内核均失败之后,计算机放弃,我在No kernel
上看到jupyter-lab
)
我很难找到错误的原因,因为据我所记得,我没有对任何Python安装解释器或类似的东西进行任何更改。另外,其他通过Anaconda安装的应用程序,例如Spyder
,也可以正常工作。
我唯一想起的更改是我为Firefox
添加了手动代理配置,该配置一直是我的默认浏览器。不过,我在No proxy
上将选项重新设置为Firefox
,它不起作用。除此之外,如果将默认浏览器设置为google chrome
,也会遇到同样的问题。
有人吗p>