繁体   English   中英

使用pyinstaller创建后无法运行python exe文件

[英]Cannot run python exe file after create with pyinstaller

所以我有这个python项目,它使用argparse库来接受arguments 当我使用此命令使用.py文件运行项目时:

python c:\projects\proj1\main.py --user blabla --password 12345678

都好。

现在我使用pyinstaller创建.exe文件,这个命令:

py_installer_path\pyinstaller.exe --onefile c:\projects\proj1\main.py

当我尝试运行它时:

c:\main.exe --user blabla --password 12345678

我收到此错误:

usage: main.exe [-h] -u USER -p PASSWORD
main.exe: error: the following arguments are required: -u/--user, -p/--password

编辑

好的,问题出在undetected_chromedriver上:

init中的文件“undetected_chromedriver_ init _.py”,第 388 行
文件“undetected_chromedriver\dprocess.py”,第 37 行,在 start_detached 文件“multiprocessing\connection.py”,第 255 行,在 recv 文件“multiprocessing\connection.py”,第 310 行,在 _recv_bytes

这个模块安装在我的环境中,正如我提到的,当我使用env文件运行脚本时,它工作.py 有什么建议么?

缺少主要代码时调试起来非常困难。 如果它是敏感代码,只需创建一个简单的 function 即可作为示例。 如果将其缩小到几行代码,它也可能有助于调试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM