简体   繁体   中英

Unable to run the exe file in python

I have created the exe file using pyinstaller . I have run pyinstaller from the scripts folder of the Python package folder. The exe file appeared in build folder.

However, when I am trying run the exe file, it blinks open the black screen with cursor pointed at the zero-th position and goes away.

"The code works just fine when run on Jupyter Notebook."

Have any of you faced the similar problem? Any help is appreciated.

Thank you!

Try to rename your main python file from *.py to *.pyw. I use the following batch script for the last 5 years:

set VS100COMNTOOLS=%VS140COMNTOOLS%


copy /Y LazAngebote_APP.pyw LazAngebote_APP.old
copy /Y LazAngebote_APP.py LazAngebote_APP.pyw
setlocal
set PATH=C:\Python34;%PATH%

pyinstaller -y -D --name LazAngebote --paths "C:\Windows\System32\downlevel" --windowed -i C:\path_to_icon\ICONS\AI-2.ico --clean --distpath="." -p "c:\Python34\Lib\site-packages\PyQt4" LazAngebote_APP.pyw

pause

If it still don´t work, copy the *.exe to a cmd/terminal an see if any errors where shown.

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