-1

我正在尝试使用 python openalrp 读板项目,但出现错误。你能帮忙吗?

parser.add_argument("--config", dest="config", action="store", 
default="ALRP/openalpr.conf",
              help="Path to openalpr.conf config file" )
parser.add_argument("--runtime_data", dest="runtime_data", action="store", 
   default="ALRP/runtime_data",
              help="Path to OpenALPR runtime_data directory" )
parser.add_argument('plate_image', help='License plate image file')
options = parser.parse_args()

错误定义如下:

用法:test.py

           [-h] [-c COUNTRY] [--config CONFIG]
           [--runtime_data RUNTIME_DATA]
           plate_image
           test.py: error: the following arguments are required: plate_image
4

1 回答 1

0

这似乎不是一个airp问题。

如果您查看错误的堆栈跟踪(通过不捕获它),您会发现它来自argparse.

因为这条线:

parser.add_argument('plate_image', help='License plate image file')

您需要将参数传递plate_image给程序。

于 2019-02-24T21:47:12.353 回答