An exception has occurred, use %tb to see the full traceback.

Published by onesixx on

Jupyter Notebook에서 args = parser.parse_args() 에서

parser = argparse.ArgumentParser()
parser.add_argument("-u", "--url", help="URL of youtube")  #  required=True,
args = parser.parse_args()

#============================================
usage: ipykernel_launcher.py [-h] [-u URL]
ipykernel_launcher.py: error: unrecognized arguments: --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"d019a33f-593d-4cf8-bd5b-12607a1fcd7f" --shell=9007 --transport="tcp" --iopub=9009 --f=/tmp/tmp-1807126qu1b5N05fPa.json
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

args = parser.parse_args() 대신

args, _ = parser.parse_known_args() 로 변경

args = parser.parse_known_args()

Categories: Python Basic

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x