【问题标题】:fbs freeze failed with Python 3.6.4使用 Python 3.6.4 冻结 fbs 失败
【发布时间】:2020-01-15 10:14:52
【问题描述】:

我在使用 fbs 和 Python 时遇到以下问题:我尝试编译 Python 代码并想在 windows 中创建一个可执行的 .exe 文件。命令 fbs run 工作正常,但 fbs freeze 失败。

软件包版本:

Python 3.6.4 PyInstaller:3.4 PyQt5:5.9.2

我导入的包:

import re
from itertools import chain

import os
import pandas
from PyQt5.QtWidgets import *
from fbs_runtime.application_context.PyQt5 import ApplicationContext

您在附图中看到的 fbs freeze --debug 的输出:

【问题讨论】:

  • 我也面临同样的问题。你找到解决方案了吗?
  • 请检查您的 pyinstaller 版本,pyinstaller 3.5 版工作正常。如果您的版本高于 3.5,则降级到 3.5(pip install pyinstaller==3.5)它可以正常工作

标签: python-3.x compilation exe freeze fbs


【解决方案1】:

我使用 pyinstaller 命令来创建 exe。这在没有 fbs 的情况下是可能的。只需 pyinstaller 和标准 cmets pyinstaller "...." --onefile --noconsole。 它适用于 Python 3.6.4 和 pyinstaller 3.4。也许 3.5 也可以。但我至少知道带有最新 pyinstaller(甚至来自 git 的开发版本)的 Python 3.8.0 不起作用。我用的是PyQt5,但是有些旧版本5.12....

有点不透明……

最好的问候, 马库斯

【讨论】:

  • 根据fbs manual,不支持 Python > 3.6。我们遇到了同样的问题,但降级解决了很多问题。
【解决方案2】:

fbs 在 python 3.6.x 上运行得非常好(我使用的是 3.6.8、PyQt 5.9.2、PyInstaller 3.4)。

如果堆栈中较早发生另一个错误,python 编译器有时会感到困惑。通常,如果 fbs freezefbs run 工作时出错,则表示库包含错误。

请在此处查看我的答案,以在您的 ./src/freeze/windows/ 目录中包含必要的 python 库资源并再次尝试冻结:The 'google-api-python-client' distribution was not found and is required by the application with pyinstaller

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-11-02
    • 2017-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-27
    • 1970-01-01
    相关资源
    最近更新 更多