mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-25 11:45:49 +03:00
[GH-ISSUE #29] Fatal Error! - Failed to execute the script #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Pechi77 on GitHub (Nov 10, 2018).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/29
Hi, I created a tkinter application and tried converting it to exe using
auto-py-to-exe.when I run the exe I get
Fatal Error! - Failed to execute the scriptplease help.
My code:
`import os
import tkinter
from tkinter import messagebox
from tkinter import filedialog
from tkinter import *
import time
import sys
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
import win32com.client as win32
import time
import numpy as np
import traceback
import datetime
def config():
return datetime.date.today() < datetime.date(2018,11,16)
#b=tkinter.Tk()
def send_email(to_addr,subject,carrier_name,vr_id,trailer):
def process(fc_value,file_addr):
try:
carrier_df=pd.read_excel(file_addr)
#drop_down_value=str(sys.argv[1])
url= 'https://mysite.com'
a=tkinter.Tk()
a.geometry("500x600+500+100")
a.title('Early pull Application by ROC')
def set_value(text):
fc_value=text_textbox1.get()
file_addr=text_textbox2.get()
status='processing'
if config():
status=process(fc_value,file_addr)
my_label2.config(text=status)
def fileopen():
file1=filedialog.askopenfile()
file1=file1.name
text_textbox2.set(str(file1))
#defining objects
my_label2=tkinter.Label(a,text="Facility Code ex - ONT8",fg="green",bg="white",font=("aerial",10,"italic"))
text_textbox1=tkinter.StringVar()
text_textbox2=tkinter.StringVar()
my_msgbox=tkinter.Entry(a,textvariable=text_textbox1)
my_button=tkinter.Button(a,text='Go ',command=lambda : set_value('dfdf'))
txt_label=tkinter.Entry(a,textvariable=text_textbox2,width=38)
btn_browse=tkinter.Button(a,text="Browse",fg="red",bg="white",command=fileopen)
#placing objects
btn_browse.place(x=300,y=200)
txt_label.place(x=43,y=200)
my_label2.place(x=15,y=100)
my_msgbox.place(x=45,y=130)
my_button.place(x=220,y=120)
a.mainloop()
`
@brentvollebregt commented on GitHub (Nov 10, 2018):
Most of the time this is not an issue with auto-py-to-exe or PyInstaller but incorrect configuration (which is ok). This means you will then need to enable debugging for the project to investigate the issue and hold on to any output.
To enable debugging, go into the "Advanced" section and under the title "How to generate" put 'all' in the box beside --debug. This will print out messages to the console to help you debug.
When debugging, make sure you selected the "Console Based" button and using "One Directory" will help remove basic problems; you can switch back to "One File" when there are no more bugs and then fix the ones associated with "One File".
After re-packaging your project, open up cmd, use the cd command to change directories to where the exe is located and then execute ./my_project.exe (substitute the names). This will run the executable and any errors you were missing before will be output to the console.
@Pechi77 commented on GitHub (Nov 10, 2018):
thanks for your response,
after following the steps.
I am getting the below error in auto-py-exe window and exe is not generated.
@brentvollebregt commented on GitHub (Nov 10, 2018):
What command is being executed? This is displayed at the bottom of the UI.
@Pechi77 commented on GitHub (Nov 11, 2018):
This is the command, @brentvollebregt
pyinstaller -y --debug all "D:/Pechi/selenium_link/selenium_link/final/my_tkinter_new.py"I think I am running cmd in wrong location, it looks for a file called
allin the running directory@Pechi77 commented on GitHub (Nov 11, 2018):
Works fine after updating pyinstaller. Thanks for your time @brentvollebregt . You are a life savior
@brentvollebregt commented on GitHub (Nov 11, 2018):
requirements.txt states that PyInstaller 3.4 or above is required. In the output you have pasted here, PyInstaller 3.3.1 was being used.