Python Forum
.exe created with pyinstaller fails to execute
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.exe created with pyinstaller fails to execute
#1
Hi, I would appreciate some guidance as I am new to Python.
I have created a very simple programme ("tables.py" code included below)and compiled it using pyinstaller (using Windows 10 Powershell). That all seemed to complete successfully (The command and responses included below.)
The file "tables.exe" is created in the folder ...scripts/dist.
When I run it I get a pop up window that says "Fatal error detected", and "Failed to execute script Tables", and has a button labeled "OK", which just causes the pop up to go away.
I would appreciate any help anyone can give me as I don't have a clue what to do. Thanks,

Ian

PS C:\Users\Ian\AppData\Local\Programs\Python\Python38-32\Scripts> .\pyinstaller --onefile --windowed tables.py 91 INFO: PyInstaller: 3.6 91 INFO: Python: 3.8.2 91 INFO: Platform: Windows-10-10.0.18362-SP0 94 INFO: wrote C:\Users\Ian\AppData\Local\Programs\Python\Python38-32\Scripts\tables.spec 96 INFO: UPX is not available. 97 INFO: Extending PYTHONPATH with paths ['C:\\Users\\Ian\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts', 'C:\\Users\\Ian\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts'] 98 INFO: checking Analysis 237 INFO: checking PYZ 274 INFO: checking PKG 368 INFO: Building because C:\Users\Ian\AppData\Local\Programs\Python\Python38-32\Scripts\build\tables\tables.exe.manifest changed 368 INFO: Building PKG (CArchive) PKG-00.pkg 4074 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully. 4143 INFO: Bootloader c:\users\ian\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe 4144 INFO: checking EXE 4160 INFO: Rebuilding EXE-00.toc because tables.exe missing 4161 INFO: Building EXE from EXE-00.toc 4162 INFO: Appending archive to EXE C:\Users\Ian\AppData\Local\Programs\Python\Python38-32\Scripts\dist\tables.exe 4179 INFO: Building EXE from EXE-00.toc completed successfully.

The code in "tables.py"

import random
print ("test your tables")
choice = input("Want to choose a table? y/n: " )
if choice == "y":
tablechoice = int ( input ("Which One? 1 to 12:"))
trials = 1
while trials < 100:
trials = trials + 1
if choice != "y":
a = random.randint(1, 12)
else:
a = tablechoice
b = random.randint(1,12)
print( "what is", a, "times", b, "?")
answer = int (input())
while 1==1:
if answer == a * b:
print ("well done")
break
else:
print ("try again")
print( "what is", a, "times", b, "?")
answer = int (input())
Reply


Messages In This Thread
.exe created with pyinstaller fails to execute - by iankerr - Apr-20-2020, 01:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo exe created by pyinstaller only works in the dist directory dee 7 2,942 Feb-23-2023, 05:53 PM
Last Post: dee
  PyInstaller fails after changing 32 to 64 bit pynz 3 3,657 Nov-27-2019, 08:12 AM
Last Post: buran
  Pyinstaller with Sys.Argv[] - “Failed to Execute Script”? ironfelix717 0 5,379 Aug-07-2019, 02:29 PM
Last Post: ironfelix717
  Help with PyInstaller + Script "Failed to Execute Script" ironfelix717 2 9,616 Jul-31-2019, 02:18 PM
Last Post: ironfelix717
  Pyinstaller can not execute script. negru555 0 2,544 Jan-27-2019, 05:15 PM
Last Post: negru555
  Pyinstaller to execute a script in command prompt Ciroxxx 0 2,130 Sep-18-2018, 10:17 AM
Last Post: Ciroxxx

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020