Pygame executable not working on another PC
2 possible errors:
1. You forgot to place a file in the .zip
You should use PyInstaller instead of cx_Freeze: you just need to type one line of code in the command prompt, you don't need any other file, and you have the possibility to convert your .py
/.pyw
file into only one .exe
file, without a whole bunch of other files.
This way you can't miss any file in the .zip
.
2. You are on win64 and you are sending the program to a win32 computer (or vice versa)
To avoid that issue, you can either:
- Reinstall the win32 version of Python
- Convert your file to
.exe
from a win32 computer.
Links to related answers: 1 and 2
Failed to execute script error after successful execution exe
I figured it out!! All I needed to do was change exit()
to sys.exit()
(and add import sys
as well).
No module named pygame on a python to exe file
pip install pygame
is the command you are looking for.
Run this command in your terminal and then try again.
Related Topics
Multiple Linear Regression in Python
How to Write Inline If Statement for Print
Dropping Infinite Values from Dataframes in Pandas
Full Examples of Using Pyserial Package
How to Change Plot Background Color
How to Declare an Array in Python
Defining Private Module Functions in Python
Python: Change the Scripts Working Directory to the Script's Own Directory
How to Use Youtube-Dl from a Python Program
How Many Concurrent Requests Does a Single Flask Process Receive
Differencebetween Using Loc and Using Just Square Brackets to Filter for Columns in Pandas/Python
How to Detect the Python Version at Runtime
Django Datetime Issues (Default=Datetime.Now())
How to Add a New Column to a Spark Dataframe (Using Pyspark)
Pass a Parameter to a Fixture Function