【发布时间】:2021-01-12 06:39:06
【问题描述】:
我的代码很长,运行时不断收到此错误。有谁知道这个错误是关于什么的?
`用法:ipykernel_launcher.py [-h] -m MODE
ipykernel_launcher.py: error: the following arguments are required: -m/--mode
An exception has occurred, use %tb to see the full traceback.
SystemExit: 2`
【问题讨论】:
-
看起来您正在启动一个具有
argparse命令行解析器的jupyter-notebook。那是行不通的。您在启动jupyter时提供的命令行值仅适用于服务器。如果按照usage的建议给出命令行参数,此代码可能会作为常规 python 脚本工作。 -
@hpaulj 我在使用 ipython 时遇到同样的错误。