python - 如何部署pyside2应用程序? -Qt方式

标签 python qt qt5 pyside2

我需要为所有主要的3种操作系统(Windows,Linux和MacOS)部署基于Qt 5.12.1的 pyside2 应用程序。

我已经检查了How to make a Python script standalone executable to run without ANY dependency?,但是那不是我想要的,因为我需要Qt相关的方法,例如windeployqtmacdeployqtlinuxdeployqt(单独的项目)。

正如eyllanesc指出的那样:“python是一种不会生成二进制文件的脚本语言”。但是,Qt公司也应该考虑到这一点,并使我们更容易部署 pyside2 应用程序。至少与部署C++/QML应用程序一样容易。

所以我想要像Windowsdeployqt,macdeployqt,linuxdeployqt这样的工具...该工具可用于 pyside2 应用程序。

[更新]
eyllanesc建议使用fbs (fman build system)作为起点,因为没有官方的工具来部署 pyside2 应用程序。这应该作为一种解决方法。也欢迎新的答案。
当Qt公司发布正式工具时,请尽快回答。

[注意]:我正在使用基于Qt 5.12.1的Qt Creator 4.8.1

最佳答案

目前尚无Qt方式来部署PySide2应用程序(而且我认为至少在不久的将来不会有这种方式)
关于此主题,有以下报告:PYSIDE-901PYSIDE-913,其中指出,对于Qt for Python 5.13,可能会更新文档,并且会有一部分用于部署。您可以看到进度here
参见Deployment
在其中进行部署的3个选项:

The options for a project are:

  1. Sending a normal zip-file with the application's content.
  2. Building a proper Python package(wheel): https://packaging.python.org
  3. Freezing the application in a single binary file, or into a directory.

在第三个方法中,他们评论了PyInstallercx_Freezepy2exepy2app之类的工具的优缺点,最终表明,最适合他们的选择是cx_Freeze或Pyinstaller。还有另一个有趣的工具是fbs项目(基于Pyinstaller)。
我个人认为fbs是因为它提供了一种基于PyQt5或PySide2打包项目的简单方法

关于python - 如何部署pyside2应用程序? -Qt方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55544964/

相关文章:

python - 在Python中以AM/PM格式显示特定时区的unix时间

python - 匹配 DataFrame 列中字符串中的独立单词

c++ - C1083 : Cannot open include file: 'GL/gl.h' : No such file or directory

c++ - 带有字符串的奇怪 Qt 代码

windows - qmake "system"命令总是返回成功代码

python - 如何强制 Django 的 urls.py 正则表达式仅限于 ASCII 数字?

python - Lambda层: An op outside of the function building code is being passed a “Graph” tensor

c++ - 运行时错误 : could not start server

qml - 第二次点击后图像大小不同

c++ - 候选人期望 6 个参数,提供 0 个