0

I'm making a program using pyqt5, openpyxl, pandas.

enter image description here

It's a program that brings only the necessary data of Excel files when I push "Save" button. It works well on my computer.

After converting it into an .exe file through pyinstaller, however, errors appear as shown in the picture below.

enter image description here

I hope to know the reason and solution. Thank you in adavance for the help

The code after line 143 is as follows.

def save_buttonClicked(self):
        
    desktop = self.desktop_textbox.text()
    dataweb = self.dataweb_textbox.text()
    prt = self.PRT_textbox.text()
    rft = self.RFT_textbox.text()
    tf  = self.TF_textbox.text()

    data1 = pd.read_excel(dataweb, engine= 'openpyxl')
    data2 = pd.read_csv(prt, encoding='euc-kr')
    data3 = pd.read_csv(rft, encoding='euc-kr')
    data4 = pd.read_csv(tf, encoding='euc-kr')

. . .

result = pd.concat([data1, df2, df3, df4], axis=1)

    result.to_excel(desktop+'/R-EPS.xlsx', sheet_name='R-EPS', index=False, header=True)

    wb = openpyxl.load_workbook(filename=desktop+'/R-EPS.xlsx')
    ws = wb.active
    ws = wb['R-EPS']

. . .

wb.save(desktop+'/R-EPS.xlsx')

    excel = win32.gencache.EnsureDispatch('Excel.Application')
    load_wb = excel.Workbooks.Open(desktop+'/R-EPS.xlsx')

    sheet_list = []
    for sh in load_wb.Sheets:
        ws = load_wb.Worksheets(sh.Name)
        ws.Columns.AutoFit()
        ws.Rows.AutoFit()

    load_wb.Save()
    excel.Application.Quit()

    self.closeEvent(QCloseEvent)
benson23
  • 8,765
  • 8
  • 15
  • 32

0 Answers0