简体   繁体   English

部署跨平台的Python Qt应用程序:Win,OSX,Linux

[英]Deploying Python Qt application cross-platform: Win, OSX, Linux

We are designing open source UI controller application for Plone CMS. 我们正在为Plone CMS设计开源UI控制器应用程序。 The application itself would be just simple start/stop dialog window for Plone daemon process, mainly aimed for Windows users. 应用程序本身只是Plone守护程序进程的简单启动/停止对话框窗口,主要针对Windows用户。

However we are hoping to use the same app for OSX and Linux. 但是我们希望为OSX和Linux使用相同的应用程序。

We can create the code for Python Qt application, but we feel unsure about the deployment process. 我们可以为Python Qt应用程序创建代码,但我们对部署过程感到不确定。 In the optimal case we'd hope to create static builds (.exe for Windows, .dmg for OSX) all megabyte so Qt included for our tiny Python script, just to maximize the ease for the end user. 在最佳情况下,我们希望为所有小兆字节创建静态构建(Windows的.exe,OSX的.dmg),以便为我们的小型Python脚本提供Qt,以最大限度地提高最终用户的易用性。

Are there any examples, scripts, etc. to build Qt friendly installers cross-platform? 是否有任何示例,脚本等可以构建跨平台的Qt友好安装程序? What other best practices we should consider? 我们应该考虑哪些其他最佳做法?

PyInstaller is a nice one to create executables and it comes with full PyQt support. PyInstaller是一个很好的创建可执行文件,它具有完整的PyQt支持。 It says it can create executables for Windows, OsX and Linux but I've never used it for anything other than Windows. 它说它可以为Windows,OsX和Linux创建可执行文件,但我从来没有将它用于除Windows以外的任何东西。 For Windows, it was quite painless and easy. 对于Windows,它非常轻松和简单。

This doesn't address the packaging/deployment component of your question, but might be a useful side note.... 这不涉及您的问题的打包/部署组件,但可能是一个有用的附注....
If you haven't already, you may want to consider PySide for your Python bindings, instead of PyQt. 如果您还没有,可能需要考虑使用PySide进行Python绑定,而不是PyQt。 The licensing terms are more permissive (LGPL) than PyQt, and may be more appropriate unless you're commercially licensed. 许可条款比PyQt更宽松(LGPL),除非您获得商业许可,否则可能更合适。

FWIW, I have successfully used py2app with PySide/Qt4 on the Mac, but don't know if it goes cross platform. FWIW,我已经成功地在Mac上使用py2appPySide / Qt4 ,但不知道它是否跨平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM