Packaging python scripts to .exe on Ubuntu - python

I have been trying to package my python scripts into .exe setup for Windows. Is that any way I can do the same while running Ubuntu?

cx_freeze is another option for freezing cross-platform.

Related

Is there a way to develop app with fork on windows then packaging to .exe

I want to develop gui app with python tkinter on windows.
I want to use fork system call. But windows does not support fork
Then its app packaging as .exe file with pyinstaller.
Is there any way to use fork on windows?
I suppose to use mingw or cygwin but I do not know how I do compile python and create windows .exe file on these environment.
I am using:
Python 3.6.4
Windows10 1709

Python standalone executable

I want to be able to create a Python standalone executable without any dependencies. Basically, an executable that is closed-source so that anyone end-user/client can use my application.
I am aware of the module py2exe; however, it appears that you need some of the .pyc files with it to actually run the .exe file.
I am using Python 2.7.x
Any help would be greatly appreciated.
Check PyInstaller. This is an alternative to py2exe
http://www.pyinstaller.org/
pip install pyinstaller
pyinstaller yourprogram.py

Convert script to executable, python not in registry

I am trying to convert a python script to an executable file.
I have tried cxFreeze and py2exe, but both told me that Python27 are not in the registry. I found several other questions that tell me to go to regedit and find the python folder, but it is not there. I tried going to HKEY_CURRENT_USER/Software and Python27 was not there.
Do I need to add it there to run the installer for cxFreeze or py2exe or is there another way?
Tools like PyInstaller package python scripts with the python run-time interpreter into standalone Windows applications. Installation of python (2.7.x) and all required python libraries is a prerequisite.
My suggestion is to install the latest Python 2.7 from this location: https://www.python.org/downloads/release/python-2710/. Make sure to choose the correct architecture, apparently 32-bit is the easiest to get working.
I fixed the issue. Apparently I accidentally installed 32-bit Python on a 64-bit machine. So I have to use the 32-bit installer because it installs the registry key in a different place. Thanks for the help anyways.

Fail to compile a python script with dependencies

I have a tiny (70 lines) python script and I need an executable which includes all the dependencies of the script. It should be usable on windows, where python-magic is only usable in connection with cygwin.
Now I've tried to use Nuitka, which gives me a 6MB executable, however it's not executable on windows, as it states it's not a valid executable, without any further information on why it's not.
Then I've been told to try cx_freeze, which I'm unable to install. Pip states my python version is incompatible. (tried it with pip and pip3 and python is installed..)
How could I get an executable for windows, including all dependencies from my python script written on a Unix system.
Windows system: Windows 8.1 64bit
Unix system: Debian Testing; Python 2.7 and 3.4 installed
I'm using python 2.7 on windows 8.1 and pyinstaller works perfectly fine.
If you want to compile an exe file which can be ported without any DLL files or anything you should use the following pyinstaller command:
python pyinstaller.py --onefile your_script_file.py
Try Pyinstaller, it is very useful to make any executable. And If you need a windows executable you have to compile it on Windows!

Python to Windows Executable under Wine

Has anyone successfully created a Windows executable file using py2exe, cx_Freeze or Pyinstaller under Wine from a Linux machine?
My goal is to be able to just push the code to a gitolite repository Ubuntu server then a git-hook will build the exe for windows and publish them for distribution. I've tried using cx_Freeze to no avail; pyinstaller seems to work but needs pywin32 which crashed during installation in wine.
If someone has successfully done so, how did you do it and did you have to install all the Python modules that were required by the application to be "compiled" for the wine-python installation? The specific application for which I want a windows exe is the Tryton Client.
Acсording to py2exe wiki, it produces invalid Win32 executables.

Categories

Resources