How can I make a python program run without python installed (like blender)? Is it includes liblaries to the program itself (Am I need to run "pip install which liblaries used" before running the program)? And how can i make this for a program with multiple scripts?
-
1What you are looking for are tools that embed a script, required modules and a Python interpretor in a native executable program like PyInstaller of py2exe. More hereSerge Ballesta– Serge Ballesta2020-12-11 08:49:23 +00:00Commented Dec 11, 2020 at 8:49
-
In which Operating System?goodvibration– goodvibration2020-12-11 08:56:00 +00:00Commented Dec 11, 2020 at 8:56
3 Answers
I use autopytoexe for windows applications. It has GUI and you can save the compile settings.
Comments
I don't have personal experience with this, but, as noted it the comments, it appears these are the tools that will do what you want.
Windows: https://pypi.org/project/py2exe/
MacOS: https://pypi.org/project/py2app/
Cross-platform: https://pypi.org/project/cx-Freeze/
Comments
If you are the one who did the programming, and want your program to run on a system (with or without python installed), you can convert your initial python file into an executable, that is, files with the .exe extension.
TO CONVERT - Open your Terminal:
pip install pyinstaller
After installing pyinstaller, type in: pyinstaller --onefile your_python_file.py. This will convert your file to an executable. CAVEAT: If your file will use a terminal, then put a -w after --onefile, if it is graphical, then don't. After the conversion, you can see a dist folder, it contains your .exe file. Try running your file then, and see if it runs with no error.