简体   繁体   English

Pyinstaller / auto-py-to-exe 附加文件

[英]Pyinstaller / auto-py-to-exe additional files

I have a python script that uses the face_recognition library(as well as other libraries), and want to make an.exe file out of it.我有一个使用 face_recognition 库(以及其他库)的 python 脚本,并希望从中制作一个 .exe 文件。 I use pyinstaller, but I get the following error when trying to run the.exe file:我使用 pyinstaller,但在尝试运行 .exe 文件时出现以下错误: 在此处输入图像描述

I guess it needs a hook or something, but I am not really familiar with how to write one or what the contents of it should be.我想它需要一个钩子或其他东西,但我不太熟悉如何编写一个或它的内容应该是什么。 I had a similar problem in the past with another python script I was trying to make into an.exe file, and luckily someone knew how to help me out.过去我在尝试将另一个 python 脚本制作成 .exe 文件时遇到了类似的问题,幸运的是有人知道如何帮助我。 It would be great if someone could guide me through this.如果有人能指导我完成这件事,那就太好了。

Since the exe is complaining about a missing module "pkg_resources.py2_warn2 add --hidden-import=pkg_resources.py2_warn to your build command由于 exe 抱怨缺少模块“pkg_resources.py2_warn2 将 --hidden-import=pkg_resources.py2_warn 添加到您的构建命令

To complete the job you should read https://github.com/ageitgey/face_recognition/issues/357要完成这项工作,您应该阅读https://github.com/ageitgey/face_recognition/issues/357

If you're trying to make an.exe file with libarys, I would recommend using https://pypi.org/project/auto-py-to-exe/ auto-py-to-exe, i've used it many times and it works great.如果您尝试使用 libarys 制作 .exe 文件,我建议您使用https://pypi.org/project/auto-py-to-exe/auto-py-to-exe ,我用过很多次次,效果很好。

I had the same error.我有同样的错误。 I fixed this by adding the required libraries to the python environment that auto-py-to-exe or pyinstaller uses我通过将所需的库添加到 auto-py-to-exe 或 pyinstaller 使用的 python 环境来解决此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM