简体   繁体   中英

Cannot run python exe file after create with pyinstaller

So I have this python project that using argparse library to accept arguments . When I run the project using the .py file using this command:

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

All good.

Now I create .exe file using pyinstaller and this commend:

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

And when I try to run it:

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

I received this error:

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

EDIT

Ok so the problem is with undetected_chromedriver :

File "undetected_chromedriver_ init _.py", line 388, in init
File "undetected_chromedriver\dprocess.py", line 37, in start_detached File "multiprocessing\connection.py", line 255, in recv File "multiprocessing\connection.py", line 310, in _recv_bytes

This module is install on my env and as i mentioned this works fine when I run the script using the .py file. Any suggestions?

It is extremely hard to debug when missing the main code. If it is sensitive code, just create a simple function that can work as a example. It might also help you debug if you narrow it down to a few lines of code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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