You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PyInstaller打包后运行可执行文件报‘pyarrow.vendored.version’错误求助

解决PyInstaller打包后‘pyarrow.vendored.version’错误的方案
  • 显式添加隐藏依赖
    PyInstaller经常会漏掉pyarrow的部分子模块,打包时直接指定缺失的模块即可:

    • 直接用命令打包:执行 pyinstaller --onefile -w --hidden-import pyarrow.vendored.version "file.py",如果还有其他相关模块缺失,继续追加--hidden-import pyarrow.vendored.xxx即可
    • 用spec文件打包:如果已经生成了spec文件,打开后找到hiddenimports=[],修改为hiddenimports=['pyarrow.vendored.version'],再执行pyinstaller "file.spec"重新打包
  • 升级依赖版本
    旧版本的pyarrow和PyInstaller可能存在兼容性bug,先升级到最新稳定版:
    执行 pip install --upgrade pyarrow pyinstaller,之后再重新打包测试

  • 手动添加缺失文件
    如果上面的方法都没用,找到pyarrow安装目录下的vendored/version.py文件(可以用pip show pyarrow查看安装路径),然后:

    • Windows系统:执行 pyinstaller --onefile -w --add-data "实际路径/pyarrow/vendored/version.py;." "file.py"
    • Linux/macOS系统:执行 pyinstaller --onefile -w --add-data "实际路径/pyarrow/vendored/version.py:." "file.py"
      也可以直接把version.py复制到打包后的可执行文件同目录下,再运行程序

内容的提问来源于stack exchange,提问作者Raymond Swenton Jr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 05:39:52