The .exe file I converted from Pyinstaller can't be run - python

I have made a python file and it is a pygame. I want to convert it into a .exe file.
So, I used PyInstaller
I did pyinstaller --one file -w main.py
and it made a .exe file.
However, when I double-click it, it popped up a
Not Running warning
Why does it occur and what should I do to prevent it?

Related

pyinstaller .exe file doesn't work on another computer

I have used pyinstaller to compile the py file into exe, on my computer it is working well
but when i am trying to download it on another computer it's always giving me error,
FileNotFound: no such file or directory when i compiled the py file i added the python39.dll.
here is the command i used:
pyinstaller --noconfirm --onefile --console --add-binary "C:/Users/Usern/Desktop/dist/python39.dll;." "C:/Users/Usern/Desktop/dist/m.py"
I am trying to create a file with this command:
f1 = open("C:\\Users\\Usern\\AppData\\Local\\Mine\\x.exe", "wb").write(x_req)
again in my computer that .exe file works well as should be but in another computer it does not work.
The program is trying to pull in a file that isnt on the computer. I had the same problem when my program used an image, it had to be in the same directory.

How to convert .py file to .exe file with pyinstaller

I am getting a error in converting a .py file to .exe file. The exe file shall be delivered at the build folder but it was not there.
In the explorer, go to the .py file you want to convert to an .exe
Click the path and write cmd
In the terminal that should have popped up, type pyinstaller --onefile (and -w if your program doesn't require the terminal) filename.py
Hit enter and wait for it to convert
The .exe now should be in the dist folder, which is in the same folder your .py file is in
Good luck! :)

Converting a python file into executable file

I build a simple bouncing ball game using python and kivy and the game is working properly without any errors. To add Gui I have used .kv file. Then I converted the Python file into an executable file using the pyinstaller module to convert the .py file I have used the statement pyinstaller -F PingPong.py
It has generated the .exe file but when I run the .exe file it just opens a black window and gets closed after few second.
Can anyone please tell me why is it behaving like this and how to convert the .py into .exe
Thank you!

pyinstaller compiled .exe does nothing

Wrote a game and compiled it with pyinstaller. An EXE file was created but when I go to run it, it thinks for 3-4 seconds and then it returns to command prompt.
Clicking from the folder in Windows does nothing.
No errors, nothing! Do I need something in my code to allow this to run? The only imports are tkinter and random.
Edit 1: tested a "hello world" script to see if there were issues with pyinstaller, it ran fine.
I understand that the post is older, but it may be useful for other member who may come across the similar problem.
I had created a script using Jupiter notebook and it creates ipynb file.
When I create an exe file using pyinstaller, the exe was doing nothing.
I resolved it by first converting ipynb file to py file using below command:
pyinstaller my_script.py
It will create the py file under same location.
Now, execute below command to create exe file:
pyinstaller my_script.py
It will create exe file under dist folder.
And it works.

How to convert .py script and .ui file with images to .exe

I wrote a program in Python that includes external files, including images and a GUI .ui file.
I want to convert the Python script to a single executable (.exe) file using PyInstaller. When I try to open the .exe file, the program does not open.
You will need more information on why the application is closing immediately in order to solve your problem. To view the error messages associated with running your executable, run the .exe file from the command prompt: /path/to/app/dist/MyApp.exe. This will allow you to observe any errors that may exist after the app was bundled. If the program fails during an import statement, you may need to add a package to the hiddenimports list in the .spec file. Check the PyInstaller documentation for instructions on modifying the .spec file.

Categories

Resources