Converting Python 3.6 script to .exe? [duplicate] - python

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,

Related

Python script multiexecution [duplicate]

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 1 year ago.
I want to execute three python script that I have developed. I found one doubt, how could I do it using a python script?
I want to convert it into a .exe, because our solution is thought to be executed in machines without python installed so having an unique script would be helpful.
Edit: I don't know the cause of the closure, I know how to use pyinstaller, my question was how can I execute 3 python using a python script or if it is possible.
Any suggestion? Thanks!
To package script and all dependencies you can use Pyinstaller, see here.
To execute multiple script (or exe) you can write a bat file that start the 3 exe or use them as services, based on your needs.
Use pyinstaller it can convert python to executables. You can get it up and running simply by doing
pip install pyinstaller
pyinstaller myfile.py

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

converting python file contaong pyqt5 and mysql connector to .exe [duplicate]

This question already has answers here:
How can I convert a .py to .exe for Python?
(8 answers)
Closed 2 years ago.
Iam developing a python program which included pyqt5 and also mysql.connector for using mysql as back end.
I have almost completed the program and it contains about 20 .py files for different qt window.
How to convert this to .exe format?
Have you considered using Pyinstaller?
It's as simple as installing it:
pip install pyinstaller
and then running it against the name of your main python file. E.g., if it's called main.py:
pyinstaller --onefile main.py

How to convert python(.py) file to unreadable code format [duplicate]

This question already has answers here:
Python Code Obfuscation [closed]
(7 answers)
How to obfuscate Python code effectively? [duplicate]
(22 answers)
Closed 2 years ago.
I have written python code and saved as program.py file.Now When i open "program.py" file it should be unreadable format.
Can anyone suggest me how to fix this issue.
You can creat pyc file with compileall:
Put your python files in a folder and run the command in this folder:(Source)
python -m compileall .
This command will produce a pyc file in __pycache__ folder. You can use this file like other python files:(Source)
python myfile.pyc
One way to do that is by compiling the source code using the py_compile module:
python -m py_compile my-py-source.py
The compiled source code will be in _pycache/my-py-source.pyc (relative to your current directory). And the code will still run normally when you run python my-py-source.pyc.

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