Release python executable with dependency on pytho

2019-05-24 11:03发布

问题:

I use the PyQt python binding of Qt C++ for creation of the GUI of my program. If I were to distribute/release the program as a simple executable, preferably for several common platforms, how should I do this the 'right' way?

Currently Qt and PyQt are installed in my environment, but I don't want any users to go through the process of installing these. I want my program to be a click-run solution. Having a hard time wrapping my head around how the Qt C++ library code and PyQt will be included locally in my project.

I am not very familiar yet with python program releases. I have noticed there isn't really much of an equivalent to .jar packages for python and it's that kind of result I'm looking for. Currently I'm using two python libraries which I place in the lib folder. The libraries are just the python sources with their own src folder. Is there any way to do the same with PyQt without having to install Qt in the users environment?

回答1:

If you don't mind your source code can be viewed then cx_freeze will be the best option I think, otherwise nuitka also will be a option but this will hide everything. But remember depends on how complex your libs and the modules which you using it can be hard to achieve, but give a try :)

https://github.com/kayhayen/Nuitka

https://github.com/GreatFruitOmsk/cx_freeze