进程'命令'C:/Users/xxxx/python.exe''以非零退出值1结束
Posted
技术标签:
【中文标题】进程\'命令\'C:/Users/xxxx/python.exe\'\'以非零退出值1结束【英文标题】:Process 'command 'C:/Users/xxxx/python.exe'' finished with non-zero exit value 1进程'命令'C:/Users/xxxx/python.exe''以非零退出值1结束 【发布时间】:2021-06-17 12:13:11 【问题描述】:早上好,
我正在 android studio 中开发一个聊天机器人,并将一个 python 脚本集成到我的机器人中。 使用 chaquopy 可以正常工作,但是在我更改应用程序名称后,整个项目停止工作,它给了我这个错误:
Build failed (with 1 error)
:clean (ok)
:app:clean (ok)
:app:preBuild (ok)
:app:preDebugBuild (ok)
:app:compileDebugAidl (ok)
:app:compileDebugRenderscript (ok)
:app:generateDebugBuildConfig (ok)
:app:extractPythonBuildPackages (ok)
:app:generateDebugPythonRequirements
Process 'command 'C:/Users/ashlibek/AppData/Local/Programs/Python/Python38/python.exe''
finished with non-zero exit value 1
Logcat 实在是太长了,我也弄不明白哪里出了问题:
2021-03-20 09:02:44.558 7052-32520/? E/memtrack: Couldn't load memtrack module
2021-03-20 09:02:51.529 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:624691b3-7763-4912-ac36-fcda5324bd31, category:mcd-sync-data-task-category, requestId:11634, error:Error Domain=mqtt Code=3008
2021-03-20 09:02:51.538 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:d99da418-336b-452c-a712-6767184383f1, category:mcd-sync-data-task-category, requestId:14139, error:Error Domain=mqtt Code=3008
2021-03-20 09:02:51.539 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response 624691b3-7763-4912-ac36-fcda5324bd31 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:02:51.546 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response d99da418-336b-452c-a712-6767184383f1 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:02:54.296 4289-4348/? E/Watchdog: !@Sync 5646 [2021-03-20 09:02:54.295] FD count : 586
2021-03-20 09:03:00.005 5119-5119/? E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
2021-03-20 09:03:00.040 5119-5119/? E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
2021-03-20 09:03:19.903 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.905 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.927 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.930 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.943 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.946 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.949 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.955 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.958 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.972 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:19.969 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.974 19644-32531/? E/libc: Access denied finding property "net.dns1"
2021-03-20 09:03:19.974 19644-32531/? E/libc: Access denied finding property "net.dns2"
2021-03-20 09:03:19.975 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.979 3802-4025/? E/Netd: getNetworkForDns: getNetId from enterpriseCtrl is netid 0
2021-03-20 09:03:19.988 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:19.990 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.004 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.022 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.026 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.036 4289-4560/? E/NetdEventListenerService: handleMessage: when=-1ms what=10001 obj=com.android.server.connectivity.NetdEventListenerService$DnsResultParams@968a043 target=com.android.server.connectivity.NetdEventListenerService$DnsEventHandler
2021-03-20 09:03:20.048 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.050 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.066 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.069 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.590 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.605 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.608 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.623 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.680 4289-4504/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.683 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.691 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.704 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.720 4289-7545/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.722 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:20.722 4289-7545/? E/WifiService: Permission violation - getConfiguredNetworks not allowed for uid=10190, packageName=com.tencent.mm, reason=java.lang.SecurityException: Location mode is disabled for the device
2021-03-20 09:03:20.736 4289-4504/? E/WifiService: 10190 has no permission about LOCAL_MAC_ADDRESS
2021-03-20 09:03:21.563 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:fcc5503f-754c-4804-b5bc-1c002add4e7a, category:mcd-sync-data-task-category, requestId:21044, error:Error Domain=mqtt Code=3008
2021-03-20 09:03:21.570 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response fcc5503f-754c-4804-b5bc-1c002add4e7a contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:03:21.570 14219-15679/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:58cbb60d-c846-4c76-a6e0-9b9c6c1c0a93, category:mcd-sync-data-task-category, requestId:8130, error:Error Domain=mqtt Code=3008
2021-03-20 09:03:21.578 14219-15669/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response 58cbb60d-c846-4c76-a6e0-9b9c6c1c0a93 contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-03-20 09:03:24.309 4289-4348/? E/Watchdog: !@Sync 5647 [2021-03-20 09:03:24.309] FD count : 586
任何帮助或建议都非常感谢..提前谢谢大家!
【问题讨论】:
改回名字还能再用吗?当您“更改项目名称”(即更改了哪些目录和文件的名称、更改了哪些文件内容等)时,您是否能够确定实际修改了什么? 我会尝试按照您的建议将其改回,然后看看会发生什么。谢谢先生。 好的,我已经改回来了,但问题还是一样。我想我会尝试创建另一个项目并将我所有的包移动到它。我看不出我要做什么的逻辑,但无论如何我都会去做。如果我得到它的工作,我会更新我的答案。非常感谢。 如果您的构建失败,那么 Logcat 就无关紧要了,因为您的应用程序从未运行过。但看起来您并没有包含整个构建日志。单击“构建:失败”标题,日志应出现在构建步骤列表右侧的窗格中。如果您没有看到该窗格,则可能已将其大小调整为空,因此请尝试从右侧将其拖回。 【参考方案1】:我解决了,这就是我所做的:
在 build.gradle(Module) 中,我有这个:
python
buildPython "C:/Users/xxx/Python38/python.exe"
pip
install "chatterbot==1.0.4"
install "PyYAML==3.13"
install "chatterbot_corpus==1.2.0"
install "click-7.1.2"
install "joblib-1.0.1"
install "mathparse-0.1.2"
install "nltk-3.5"
install "packaging-20.9"
install "pint-0.16.1"
install "pymongo-3.11.3"
install "pyparsing-2.4.7"
install "python-dateutil-2.7.5"
install "regex-2020.11.13"
install "six-1.15.0"
install "sqlalchemy-1.2.19"
install "tqdm-4.59.0"
不知何故,在我将 python 从 3.7.8 更新到 3.8.6 后,PiP 块停止运行 smoothley,现在我取消了除 Chatterbot 之外的所有这些包的注释,并且我的应用程序再次正常运行(我还没有完成所有它的功能,但至少目前构建良好)。
我不知道为什么会发生这种情况,我将对其进行更多调查以了解它,但我希望我的解决方案可以节省其他人的时间。
谢谢。
【讨论】:
请参阅我上面的评论,了解如何查看包含完整错误详细信息的构建日志。在这种情况下,原因可能是您使用了错误的版本号语法:它们应该用==
分隔,而不是-
。详情请参阅pip documentation。
@mhsmith 实际上,在我升级 python 和 chaquopy 之前它工作正常,但是当我进一步调查这个问题的原因时,我会记住你的建议。谢谢你,先生,你用 chaquopy 做得很棒的方式!以上是关于进程'命令'C:/Users/xxxx/python.exe''以非零退出值1结束的主要内容,如果未能解决你的问题,请参考以下文章
Linux 内核进程管理 ( 进程特殊形式 | 内核线程 | 用户线程 | C 标准库与 Linux 内核中进程相关概念 | Linux 查看进程命令及输出字段解析 )
进程'命令'C:/Users/xxxx/python.exe''以非零退出值1结束
centos 离开进程不 退出程序,检测进程fg、bg、jobs、&、nohup、ctrl+z、ctrl+c