Release python executable with dependency on python bindings of a C++ library

℡╲_俬逩灬. 提交于 2019-12-22 12:18:41

问题


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



来源:https://stackoverflow.com/questions/34104766/release-python-executable-with-dependency-on-python-bindings-of-a-c-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!