首页 > 解决方案 > 在ubuntu中一次调用多次调用cython转换的应用程序

问题描述

我将py代码转换为cwith cython,并在如下环境中编译为可执行应用程序ubuntu

cython mmd_ai_release.py --embed
gcc `python3.7-config --cflags --ldflags` mmd_ai_release.c -o ai_module -v -I /usr/include/python3.7/ -L /usr/lib/python3.7 -lpython3.7

我可以得到可执行软件,并且可以成功运行它,但是应用程序在一次调用中被多次调用,如下所示,我无法确定是谁调用它,以及如何防止错误调用。任何人都可以帮助我吗?

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                     
 9970 xx        20   0 2949576 706176 125276 R  80.8  1.1   0:02.44 ai_module                                                                                   
 9991 xx        20   0 2316072 211048 112616 R  53.0  0.3   0:01.60 ai_module 

终端中的打印信息如下:

usage: ai_module [-h] [--input INPUT_FILEPATH] [--label LABEL_FILE] [--output OUTPUT_FILEPATH]
ai_module: error: unrecognized arguments: -c from multiprocessing.semaphore_tracker import main;main(5)
usage: ai_module [-h] [--input INPUT_FILEPATH] [--label LABEL_FILE] [--output OUTPUT_FILEPATH]
ai_module: error: unrecognized arguments: -c from multiprocessing.semaphore_tracker import main;main(4)
usage: ai_module [-h] [--input INPUT_FILEPATH] [--label LABEL_FILE] [--output OUTPUT_FILEPATH]

标签: pythonubuntucython

解决方案


推荐阅读