cmd 运行 jupyter notebook 出错

文章描述了在使用JupyterNotebook时遇到的ImportWarning,指出traitlets模块无法导入,解决方法是通过pipuninstalltraitlets后重新安装特定版本(5.9.0)。
摘要由CSDN通过智能技术生成
  • List item

@TOCTraceback (most recent call last):
File “E:\Anaconda3\Scripts\jupyter-notebook-script.py”, line 10, in
sys.exit(main())
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\jupyter_core\application.py”, line 282, in launch_instance
super().launch_instance(argv=argv, **kwargs)
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\traitlets\config\application.py”, line 1051, in launch_instance
app = cls.instance(**kwargs)
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\traitlets\config\configurable.py”, line 575, in instance
inst = cls(*args, **kwargs)
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\traitlets\traitlets.py”, line 1311, in new
inst.setup_instance(*args, **kwargs)
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\traitlets\traitlets.py”, line 1354, in setup_instance
super(HasTraits, self).setup_instance(*args, **kwargs)
File “C:\Users\HP\AppData\Roaming\Python\Python39\site-packages\traitlets\traitlets.py”, line 1330, in setup_instance
init(self)
File “E:\Anaconda3\lib\site-packages\notebook\traittypes.py”, line 226, in instance_init
self._resolve_classes()
File “E:\Anaconda3\lib\site-packages\notebook\traittypes.py”, line 238, in _resolve_classes
warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: ‘stacklevel’

运行以下命令解决问题:

pip uninstall traitlets
pip install traitlets==5.9.0

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值