使用cx_freeze构建Python应用程序。
from cx_Freeze import setup, Executable
_packages = []
_excludes = []
_include_files = [...]
buildOptions = dict(packages = _packages, enter code here`excludes = _excludes, include_files = _include_files, build_exe = '<app name>')
setup(name = '<app name>',
version = <version>,
description = '<description>',
options = dict(build_exe = buildOptions),
executables = [Executable('<app name>.py',
targetName = '<app name>',
icon = '<app name>.png')])
[尝试在Linux上的/ usr / bin /中使用cx_freeze安装应用程序构建,并在/ usr / share /中使用应用程序资源。
当然会导致:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module name 'encodings'
Current thread 0x0... (most recent call first):...
我思考我需要设置/更改lib文件夹的默认位置,但是我一直无法弄清楚该怎么做。我完全有可能走在完全错误的轨道上。
我正在尝试避免使用bbfreeze。
查看代码后,我相信我想做的事是不可能的。 “ lib”目录在cx_freeze中进行了硬编码。