I’m having an issue with creating an executable file from my Python script using PyInstaller. The issue only occurs when I use the –noconsole option in the command, then the final .exe file gives me a fatal error during execution. ...Read more
I’m having an issue with creating an executable file from my Python script using PyInstaller. The issue only occurs when I use the –noconsole option in the command, then the final .exe file gives me a fatal error during execution. My code contains various print statements for debugging purposes, and I really don’t want the console window to open every time, but the fatal error is a big issue.
Here’s a snippet of my code:
import pandas as pd
import numpy as np
def my_function():
df = pd.read_csv('data.csv')
print(df.head())
if __name__ == "__main__":
print("Starting program...")
my_function()
And here’s the command I’m using to create the .exe file:
pyinstaller --onefile --noconsole script.py
I’ve tried various solutions suggested online, including adding an empty print statement to the code and using different versions of PyInstaller, but the issue persists. Is there a way to use the –noconsole option without encountering a fatal error? Any help would be greatly appreciated.
Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.
Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.
See less