我有以下关于fbs和Python的问题:我试图编译Python代码,并想在windows中创建一个可执行的.exe文件。命令fbs run运行正常,但fbs freeze失败。
包版本:
PyQt5 3.6.4 PyInstaller: 3.4 Python : 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的输出:

发布于 2020-01-21 21:17:10
我使用pyinstaller命令来创建exe。这在没有fbs的情况下是可能的。只需pyinstaller加上标准注释pyinstaller "....“--onefile --noconsole即可。它适用于Python 3.6.4和pyinstaller 3.4。也许3.5也可以。但我至少知道,带有最新pyinstaller (即使是来自git的开发版本)的Python 3.8.0不能工作。我使用的是PyQt5,但是是一些更老的5.12版本。
有点不透明..。
致以最好的问候,马库斯
发布于 2020-05-06 13:24:00
fbs在Python3.6.x上运行得很好(我使用的是3.6.8,PyQt 5.9.2,PyInstaller 3.4)。
如果堆栈中较早的时候发生另一个错误,python编译器有时会感到困惑。通常,如果在fbs run工作时包含错误,则指向一个库- fbs freeze错误。
要在./src/freeze/windows/目录中包含必要的python库资源,请在此处查看我的答案,并再次尝试冻结:The 'google-api-python-client' distribution was not found and is required by the application with pyinstaller
https://stackoverflow.com/questions/59749264
复制相似问题