解决 ipykernel_launcher.py: error: unrecognized arguments

详细说明

在jupyter nootbook 中运行python文件时, 报错
ipykernel_launcher.py: error: unrecognized arguments: -f /home/xxx/.local/share/jupyter/runtime/kernel-0fad9201-af20-4945-86b4-eeafe5b0d8b2.json
An exception has occurred, use %tb to see the full traceback.

解决

在原python文件中, 将用到的parser.parse_args()行改为如下代码

args, _ = parser.parse_known_args()

参见

无需修改代码,解决ipykernel_launcher.py: error: unrecognized arguments: -f /home/报错_青萍之默的博客-CSDN博客

python - How to fix ipykernel_launcher.py: error: unrecognized arguments in jupyter? - Stack Overflow

关于在jupyter notebook中解决 ipykernel_launcher.py: error_键盘强者的博客-CSDN博客

How to fix ipykernel_launcher.py: error: unrecognized arguments in jupyter?_python_Mangs-DevPress官方社区 (csdn.net)

你可能感兴趣的:(python,开发语言)