Turning a development environment into an executable - python

I have a virtual environment that has one main tkinter script, 16 python file, 5 text files, 3 PNG files and a subdirectory where PDFs will be saved. How in the world can I make a exe with all these files so that I can move it onto another computer without any of the dependencies or files installed on it?
I have tried pyinstaller but I get a fatal error when I attempted to run the exe.
How can I create one functional exe? The code is in Python 3.6.

Related

How to create exe of project who has .cxx .py file and many dlls

I have a code who is depended on Qt, PyQt, VTK, ITK, libs.
using CMAKE to build
Environment : Windows
I want to distribute EXE who has cxx, py files and related dlls
I have tried to compile and got executable but my python files are remaining necked.
I don't want to share python files as a script.
how we can make those python files as a dlls
python is often a hard language to turn to exe but the best way to do so is using the pyinstaller package. Installed by pip install pyinstaller and can turn a .py file to a .exe by pyinstaller --onefile FILENAME.py in CMD. After that your exe file should be stored in a folder called disk. The other files can just be included in the same file as the exe.
docs: https://pyinstaller.org/en/stable/

Python inclusive executable

I am struggling with creating .exe or similar formatted files with my python 3.6 project. I have success with creating an exe using pyinstaller, but it requires me to have installed the module pymysql separately and to include the icon.ico file in the same directory as the new application.
How would I go about creating a standalone executable that not only stores the icon.ico used for the program title icon, and including the pymysql module as well as seperate .py files?
I've tried using different arguments within pyinstaller, and I've looked at py2exe but this doesn't seem to support python 3.6.

How do I make an exe file from a python code under Ubuntu?

I'm using Ubuntu 16 64-bit and python 3.5
I made a program on python and I want to distribute it as an EXE for Windows users.
The program I made depends on pandas and matplotlib
I downloaded PyInstaller.tar.gz and extracted it, but I can't find any clear info on how to make make an EXE.
I tried
python ../PyInstaller/pyinstaller.py --onefile ../Project/program.py
But it creates a sub folder with a lot of files and none of them are exe

File resources in Python

I got few images and one exe file which I would like to bundle inside of the python exe file?
I mean the same or similar way that it could be done in the visual studio:
Please tell me if its possible, if so , how could I access the resources then?
I am using pyinstaller if it does matter.
You can't bundle your resources inside .Net runtime. Visual Studio allows you to bundle your resources inside your project exe not inside .net executable.
Same way you cannot bundle resources like images and exe files inside python.exe but using Pyinstaller you can create your project exe which will include your resources.
To create a single file use --onefile flag while bundling your project. As per Pyinstaller documentation -
"In a --onefile distribution, data files are bundled within the executable and then at runtime extracted into the work directory."
Here is a link for how onefile mode works

Do I need Python installed if I have PYC files?

I want to add Python as a scripting language to my game. If instead of distributing PY script, I distribute the PYC compiled files with my game, will the user still need Python installed, or will the DLL be sufficient?
Not only would they still need the Python interpreter, but the compiled python byte-code files are not guaranteed to work across different platforms.
You do need an executable to actually load the files into the VM. Fortunately it doesn't need to be very complex.
pyinstaller can be used to convert the .py file into an executable file
to install the pyinstaller
pip install pyinstaller
and to convert the .py file let's say file.py
pyinstaller file.py
this will make two new folders in the same directory
build and dist. dist folder contains all the required dll and file.exe to run the python code without python installed.

Categories