How to create an rpm from a python exe? [duplicate] - python

This question already has an answer here:
Python 3.5 create .rpm with pyinstaller generated executable
(1 answer)
Closed 2 years ago.
I have a set of python exe that is created using pyinstaller. I want to package these exe in .rpm . How do I do this ? The reason I need to do this is to enable me to install the rpm on a red hat linux server
PS : I don't have an option to switch from RPMs

I found the answer fortunately after hours of trying , you can wrap all the exe in a tar in %install stage of rpm spec and pass the name of the tar file in %file . If you have a single exe , you do not need to create a tar

Related

Create executable without console from a .pyw file [duplicate]

This question already has answers here:
How to convert a pyw file to exe?
(2 answers)
Closed 1 year ago.
I made a application that has to can run in background, so I made a script.pyw but I don't know how to make a executable that can do it .
can you please help me ?
You can use pyinstaller to do so. First, install pyinstaller:
$ pip install pyinstaller
Then, run pyinstaller, passing the file to convert
$ pyinstaller script.pyw --onefile --windowed

How to convert python file to installer [duplicate]

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 1 year ago.
Hi everyone I want to convert my python file to installer(windows installer) not executable. I already make it executable through py2exe. How can I make an Installer of it. Is it possible.
Pyinstaller is a good option to convert python scripts to an windows executable.
You can install it in cmd.exe as any user and run pip install pyinstaller or pip install --pre pyinstaller.
you can then run it using pyinstaller. (sorry that i can't supply a automated script i wrote after a system restore. I'll write it again soon using pyqt5)
syntax
--onefile - puts the program and it's files into a exe.
--onedir - put your program into a directory (folder) (faster than --onefile as it does not need to extract files)
-c - create a console app.
-w - create an app without the console.
-i "[Path to .ico or exe with icon. e.g C:\Files\CODE\Icon.ico]" - set an icon for your app instead of the default snake-on-a-floppy-disk icon.
you can read the rest here.
You can then get inno setup and create an offline installer.
[sorry, could not be bothered to type it again]
i posted it on https://stackoverflow.com/posts/61597594

How to convert .py to .exe along with all its dependecies [duplicate]

This question already has answers here:
How can I make a Python script standalone executable to run without ANY dependency? [duplicate]
(19 answers)
Closed 2 years ago.
Suppose, I want to create a .exe file and i want all my features which are depended on certain packages or modules like tensorflow etc.So,how can i do this.
You can use something like pyinstaller, you can install it like this:
pip install pyinstaller
Once you install it, use this syntax to create to an exe:
pyinstaller yourprogram.py
This will create a .exe file from your program which will be in a dist folder and will include all dependencies along with it.
Additional documentation is avaialable here on how to include an icon etc.

Converting Python 3.6 script to .exe? [duplicate]

This question already has answers here:
How can I convert a .py to .exe for Python?
(8 answers)
Closed 5 years ago.
I would like to convert a .py file to an .exe. I am using Python 3.6. I already tried py2exe and PyInstaller but they don't seem to work properly with Python 3.6.
Here is the traceback from PyInstaller.
So, let's try Pyinstaller first.
$ pyinstaller script.py --onefile
This will generate a script.spec file
in the spec file you can remove the console, debug mode etc
$ pyinstaller script.py
EDIT: Py3.6 isn't supported
If this doesn't work then we can try cx_freeze,

Change python output script format to exe [duplicate]

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 9 years ago.
Is there any way or tool to automatically change python output script format (.py) to exe ? I want to run my app on every Windows computers including that haven't got installed python.
I had to do this a while ago and I had the most success with py2exe: http://www.py2exe.org/
You create a setup.py file which gives a list of what Python code you want to include in your executable, and it packages that up along with a subset of the Python interpreter into a single exe. Works specifically on Windows. (Linux and Mac generally already have Python installed so it's much less of an issue there.)

Categories

Resources