Search code examples
pythonpandastkinterpyinstaller

Python: Having trouble functioning after compiling python into EXE


My python code that processes excel spreadsheet works perfectly by itself with py3 and IDE debugging environment. The codes takes an input.xls, covert it to dataframe, processes it, and then exports a output1.xlsx.

However, I need to take the application to a system with no python pre-installed. After following this specific pyinstaller tutorial, I managed to compile the application into a exe file but fails to function.

Error code

I would assume that the app is having difficulty picking up relative paths. I've tried googling the error code but didn't find similar error code ending with "Access is denied" rather "The Requested operation requires elevation" or other. I've also attempted elevating the app to admin. I just started software development and am pretty lost in this case. Any help guys?

P.S. I've also tagged pandas as there might be a slight chance it may be caused by pandas.


import os
from pandas import DataFrame
import pandas as pd
import numpy as np

df = pd.read_excel('Input.xls')

# Processing excelsheets

df.to_excel('output1.xlsx', index=False)

Solution

  • Because my application was console based, I was able to resolve the issue by copy-pasting the entire python 3 folder along with my python source code file, and utilizes Batch.

    .\Python\Python38\python.exe main.py
    

    auto-py-to-exe This was also extremely helpful provided by @Girish.