pkg_resources.DistributionNotFound 对于 cvlib 库
pkg_resources.DistributionNotFound for cvlib library
我已经编写了一个使用 cvlib 库的 python 脚本,但是当我 运行 代码作为 python 脚本时它工作正常;当我将代码转换为 exe 文件时,除了导入 cvlib 库之外,一切似乎都运行良好。
错误如下所示:
pkg_resources.DistributionNotFound: The 'cvlib' distribution was not found and is required by the application
The detailed Error
有没有人遇到过这个问题?如果是这样,能否请您提供正确的修复方法,因为我认为存在一些依赖性问题。
我终于明白问题出在哪里了,Pyinstaller 有时无法包含我们在 (.py) 文件中导入的一些库。因此,当 Pyinstaller 创建 (.exe) 文件时,它会忽略一些导入,因此解决方案是复制这些导入的文件夹,例如 cvlib forlder 并将其粘贴到与 (.exe) 相同的位置文件。
我已经编写了一个使用 cvlib 库的 python 脚本,但是当我 运行 代码作为 python 脚本时它工作正常;当我将代码转换为 exe 文件时,除了导入 cvlib 库之外,一切似乎都运行良好。
错误如下所示:
pkg_resources.DistributionNotFound: The 'cvlib' distribution was not found and is required by the application
The detailed Error
有没有人遇到过这个问题?如果是这样,能否请您提供正确的修复方法,因为我认为存在一些依赖性问题。
我终于明白问题出在哪里了,Pyinstaller 有时无法包含我们在 (.py) 文件中导入的一些库。因此,当 Pyinstaller 创建 (.exe) 文件时,它会忽略一些导入,因此解决方案是复制这些导入的文件夹,例如 cvlib forlder 并将其粘贴到与 (.exe) 相同的位置文件。