gpt4 book ai didi

python - Pyinstaller Tensorflow bundle 失败

转载 作者:行者123 更新时间:2023-12-01 00:09:48 25 4
gpt4 key购买 nike

尝试运行 pyinstaller 在 Windows 上编译 Tensorflow 应用程序。该文件已完美打包,但我在运行生成的 exe 时最终遇到了此错误。

 File "site-packages\astor\__init__.py", line 24, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\me\\AppData\\Local\\Temp\\_MEI138162\\astor\\VERSION'

我已确保包含 astor 软件包,甚至尝试使用 --hiden imports 标志,但无济于事。

如何在 pyinstaller 中正确包含 astor 软件包?

最佳答案

您可以在项目中创建“astor”文件夹。并粘贴“your env/Lib/site-packages/astor/VERSION”中的 VERSION 文件。

--[编辑]--

在 PyInstaller 上,您应该添加标志 --add-data 'astor:./astor' 将文件夹添加到项目中,似乎不需要源代码,只需要 版本文件

关于python - Pyinstaller Tensorflow bundle 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59702200/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com