I tell the shell to run
main.pyc but it says that
main.pyc doesn’t exist even though it does.
main.pyc runs and Bash works
It says “main.pyc not found”
Steps to reproduce:
- compile Python code (using Python)
- try to run
Bug appears at this link:
try running I visited your repl, and main.pyc is indeed in the “home” dir.
ls in the console and showing us the output. Did you mean to look in the __pycache__ directory?
Is main.pyc supposed to be an executable? Perhaps you need to run with a C interpreter?
@SnakeyKing I just found out, although main.pyc might look like an executable, you still need to run it with Python.
./main.pyc # Error
python main.pyc # Shows Hello World!
To compile Python code into an executable, try using pyinstaller:
pyinstaller --clean --onefile --distpath ./ main.py -n myProgram
./myProgram # Hello World!
Perhaps change category to Code Help
 Cannot open PyInstaller archive from executable (/home/runner/py-to-mc/build) or external archive (/home/runner/py-to-mc/build.pkg)
(btw I did
build instead of
@SnakeyKing Try using a name other than
build, as pyinstaller creates a temporary directory called
build to build the executable.
EDIT: It seems that pyinstaller is not supported by Replit (GLIBC issues).