Why can't I open my .exe after running pyinstaller?

19 views
Skip to first unread message

Justin Smith

unread,
Feb 10, 2023, 11:41:33 AM2/10/23
to PyInstaller

I'm trying to covert a python tkinder gui into an executable for my collogues with pyinstaller. The console output states that it always runs successfully however when I try to open the .exe I get an error message saying

Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access them.

I can't find anything online that has been helpful and I'm hoping someone might be able to give me a useful hint here.

My initial run is with "pyinstaller my_script.py --onefile --windowed" and after the spec is created I'll update the datas array to include a .json file that is needed for the script in the form of "datas=[('my_json.json', '.')]," (it lives in the same folder as the python script). After all this I'll rerun pyinstaller as "pyinstaller my_script.spec". But still no luck.

I've notice that in other forums when people post their console output there's a line that states: 3780 INFO: Updating manifest in "C:\Users\PATH_TO_THEIR_SCRIPT\dist\their_script.exe"

Where as mine states: 3780 INFO: Updating manifest in "C:\Users\PATH_TO_MY_SCRIPT\dist\my_script.exe.notanexecutable"

Why does mine have the "notanexecutable" appended?

Jasper Harrison

unread,
Feb 10, 2023, 12:19:40 PM2/10/23
to pyins...@googlegroups.com
Justin

The notanexecutable extension is something pyinstaller does internally to combat overly aggressive antivirus during the build process. And is irrelevant to the actual process of how the file contents is created. This isn't explained on most forums because it is a recent change.

Are you running the executable from the dist folder or the build folder?


Jasper Harrison, aka Legorooj
Core Developer on PyInstaller



-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/9de73dd7-cdc5-41c4-984e-16390ad7a59cn%40googlegroups.com.
publickey - EmailAddress(s=legorooj@protonmail.com) - 0x164CF234.asc
signature.asc

Justin Smith

unread,
Feb 10, 2023, 12:43:59 PM2/10/23
to PyInstaller
Hey Jasper,

I am running it from the dist folder. I've discovered that my windows defender has been blocking this file. I just worked with my organizations IT team to get it unblocked and it seems to be working now!

Thanks!

Reply all
Reply to author
Forward
0 new messages