Im working in a project and Im trying to create an executable file for a python program that uses anaconda, i want to create an .exe file so that i dont need to open vs studio and then run the code, whats the easiest way to do that?
Asked
Active
Viewed 864 times
-2
-
If you are on Windows, you can run the file just by typing the file name in a command shell (`'myname.py"`) Windows will find the interpreter and run it. Converting to an executable is usually only necessary if you are going to share it with someone else who does not have Python. – Tim Roberts Jun 27 '22 at 20:28
-
Why does everyone want to create an .exe file? Why not simply configure an [entry point](https://setuptools.pypa.io/en/latest/userguide/entry_point.html)? – Sören Jun 27 '22 at 20:29
-
im going to do a presentation before judges and stuff so its not really pretty to run the code in vs studio – Tomás Monteiro Jun 27 '22 at 20:50
-
@TomásMonteiro No one said you should run your code in vs studio. – Sören Jun 28 '22 at 21:25
1 Answers
1
You can use PyInstaller to 'convert' .py to .exe . You could also run it from you command window using e.g. (without opening an editor) python yourpythonprogram.py
Hope this helps, cheers,

WvdL1995
- 29
- 5
-
im using pygame and this error occurs C:\Users\Tomás Monteiro\Desktop\escola\12º ano\pap\snake-ai-pytorch-main>snake_game_human.py Traceback (most recent call last): File "C:\Users\Tomás Monteiro\Desktop\escola\12º ano\pap\snake-ai-pytorch-main\snake_game_human.py", line 1, in
import pygame ModuleNotFoundError: No module named 'pygame' – Tomás Monteiro Jun 27 '22 at 20:34