M
M
Millerish2016-06-22 14:06:54
Python
Millerish, 2016-06-22 14:06:54

What is the correct way to convert python to exe?

Hey!
Help me figure out how to create exe from Python2.7 files in Ubuntu (x64) (or at least somehow).
I'm trying to build a test project from two files (a simple check of user information using api using PySide). To build, I found pyinstaller and the command for it:

pyinstaller -D -F -n main -c main.py

If I understand correctly, it should throw python and all dependencies into exe. As a result, I get such folders and files .
If you go to dist you can see main. I don’t know what it is, but on Ubuntu it works like a python file.
I installed win7 on a virtual machine and renamed the file to main.exe, said x32, ok, installed win7x32 and then it displays the console for a second and disappears)
What is the problem, what am I sharing wrong? What type has the main file become, why does it work under Ubuntu? How to assemble under systems of different capacity?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2016-06-22
@RusTech

Collect from under Windows through py2exe. I have not tried from under Linux, but under Windows, if you collect from under x64, then the exe turns out to be x64 and does not go to x86. I admit that from under Linux, he could also assemble for the current OS.

D
Danil Solovyov, 2016-06-22
@SolovyevDanil

It is impossible to build an .exe file from under Linux, for this you need to use wine.
https://github.com/pyinstaller/pyinstaller/wiki/FA...

B
Bee3Key, 2016-06-30
@Bee3Key

Pyinstaller docs here
pyinstaller.readthedocs.io/en/stable
In a nutshell - if you compile a script under Linux, then you will have a binary to work under Linux at the output.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question