"Compiling"/package python in a exe/python to exe issue. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 3

"Compiling"/package python in a exe/python to exe issue.

I've written a few scripts, and i wanted to send them to someone who doesn't have python. I've tryed to use this: https://youtu.be/lOIJIk_maO4, but i got a .pyc (which is compiled but requires python to run). Then i tryed this: https://youtu.be/OZSZHmWSOeM. When i tried to install the requirements, it said i needed Microsoft Visual c++ 14, but they are pre-installed on windows (x64 and x86)... Useful info: I have windows 10 64bit, I'm not the admin of the pc, Do i have to install the build tools or do you have another way to py=>exe? Thank you for reading my question.

14th Jul 2018, 6:30 PM
Itskat
Itskat - avatar
4 Respuestas
+ 4
I used cx_freeze and py2exe and both worked okay. Just it is best to use a 32-bit interpreter when doing this, in order for your exe to run on any OS. The thing you need to know, though, is that there is no real compilation here. This exe file (or package) includes the *whole* Python installation plus any of non-standard libraries you import. It can often mean a 30-40MB worth of file.
14th Jul 2018, 8:40 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
Kuba Siekierzyński Thank you for your answer
15th Jul 2018, 7:36 AM
Itskat
Itskat - avatar
+ 2
umesh kumar Kumawat I tried pyinstaller but the only thing i got working was a .pyc . I did get an .exe but when I tryed to execute it i got an error message ('fatal python error' , sometime like that). Thank you for your answer.
15th Jul 2018, 9:02 AM
Itskat
Itskat - avatar
+ 1
you can try pyinstaller and py2exe for seamless conversion from .py to exe
15th Jul 2018, 8:39 AM
umesh kumar Kumawat
umesh kumar Kumawat - avatar