如何修复ipykernel_launcher.py?

时间:2019-05-17 17:53:24

标签: python-3.x

在我编译时出现错误。我尝试了不同的方法,但无法修复。

  parser = argparse.ArgumentParser(description="Predict if a Youtube 
video is clickbait or not.")
parser.add_argument(
"--title", "-t",
type=str, help="Title.", required=True)
parser.add_argument(
"--views", "-v",
type=int, help="Number of views.", required=False)
parser.add_argument(
"--likes", "-l",
type=int, help="Number of likes.", required=False)
parser.add_argument(
"--dislikes", "-d",
type=int, help="Number of dislikes.", required=False)
parser.add_argument(
"--comments", "-c",
type=int, help="Number of comments.", required=False)
args = parser.parse_args()

我的错误是

usage: ipykernel_launcher.py [-h] --title TITLE [--views VIEWS]
                         [--likes LIKES] [--dislikes DISLIKES]
                         [--comments COMMENTS]
ipykernel_launcher.py: error: the following arguments are required: --title/-t
An exception has occurred, use %tb to see the full traceback.

0 个答案:

没有答案