Fatal Error Detected: Failed to execute script main
I used the following tags:
pyinstaller --onefile -w main.py
I had dependencies, so when it finished, I moved the exe file to the main directory. I'm still getting an error. I used pygame for my project. Why?
I found the answer to my problem. It turns out, it had nothing to do with images. It had to do with the font. Normally, in PyCharm (maybe I'm mistaken) freesansbold.ttf is a default font. However, when PyInstaller packages the files, PyInstaller doesn't have the font downloaded by default, so it gives an error. All I had to do was scour the internet for the font, downloaded it, and it worked.
So yeah, pretty funny mistake.
When you are converting a .py file into .exe, PyInstaller shows the console. If there is an error in your code, it will be displayed in the command prompt.
But if you are converting a .pyw file into .exe, the error will be returned in the form of a message box instead.
So, to see your error (it is really quick though, but it is better than nothing), simply convert your file in .py format into an .exe, to see the error in the command prompt.
But when no window has been open, if there is an error at the beginning of the script, PyInstaller will not detect it as launched, so it will not show an error.
for example this program works, even if there is an error in the code:
avkzebhrkjvzebverybvzkejhrv
After converting my Python code to an executable, I am getting the following fatal errors when trying to run the program:
1. Failed to run pyiboot01_bootstrap script
2. Error: "NoneType" object has no attribute "write"
3. Error described in the figure: pic3.jpg
Error 3
Note: The program works perfectly when running on VS Code. The program is basically an interface that extracts data from a text file. I attached the program below and the screens with the code that generated my .exe file
Any suggestions?
The problem may be with pyinstaller itself..
Reinstall pyinstaller and auto-py-to-exe and try again..
I've written a Python program using pandas in Pycharm which works really well. However when I try to convert the Python program into an .exe file using pyinstaller in command prompt, the program fails. It successfully converts to an exe file but wehen I execute the program, a new window appears for 0.25 seconds and than terminates. I took a print screen of the window and the error it says is
"ModuleNotFoundError: No module named numpy. "
This is really confusing as Numpy is installed and the program executes perfectly in pycharm. I've tried copying and pasting the code to a new file, and created a new python file with that code. Still getting the same issue. I'd appreciate any advice you can provide :)
I have small program made in python with selenium, and now I'm trying to make an .exe with py2exe.. I get the exe but when I run it, terminal just pops up for split second then it terminates.
I tried to run .exe in cmd and It says that there is no such file as webdriver_prefs.json
Here is the setup.py I have:
from distutils.core import setup
import py2exe
setup(console=['file_name.py'])
Any input on how to resolve this is welcome.
Cheers.
I've got a simple script for message encryption and converting result into QR Code. It uses pycrypto, reportlab and tkinter. Here's the source: click
It works correctly, but if I build it with cx_Freeze, it crashes when attempting to encrypt a message: screenshot
P.S. I also tried py2exe, but the program crashes on start with no debug output.
I solved this issue by editing parser.py (C:\Python33\lib\html\parser.py): patch