python-3.x - cx_freeze - 如何更改对 lib 的引用
问题描述
使用 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 中硬编码。
推荐阅读
- haskell - 为什么 ParsecT 没有 MonadWriter 实例?
- c# - 无法更新 SharePoint 文档中的“Last_x0020_Modified”
- python - 应用用户定义的函数,将 kwarg 传递给多个列中存在的值
- r - 查找 Word 并添加新行
- java - 构建 tinyMediaManager 时不生成 windows 可执行文件
- javascript - 通过 .json 将数据导入 React Native 与 Redux
- java - 如何修改显示数据损坏问题的代码
- javascript - 当您控制台记录它时,Javascript Date 如何打印出一个字符串?
- sql - SQL Server 浏览器无法启动
- regex - 在字符序列上使用 grep 案例场景