是否有命令可以增强接收到的错误消息,以便 python 显示它.dll
找不到的文件?
对于错误:
python test_cv2.py
Traceback (most recent call last):
File "test_cv2.py", line 1, in <module>
import cv2
File "E:\Anaconda3\envs\py38\lib\site-packages\cv2\__init__.py", line 5, in <module>
from .cv2 import *
ImportError: DLL load failed while importing cv2: The specified module could not be found.
(py38) E:\somepath>
我想确定.dll
实际上没有找到哪个文件。为此,我DependenciesGui.exe
从这个存储库下载并运行。. 接下来,我喂DependenciesGui.exe
了cv2.cp38-win_amd64.pyd
它指示api-ms-win-core-wow64-l1-1-1.dll
丢失,等等。
我目前无法验证.dll
报告丢失dependenciesGUI.exe
的文件是否也是 python 3.8 在 anaconda 环境中找不到的文件。
一种隐式验证 python 3.8 丢失.dll
文件与报告丢失的相同文件相同的方法是dependenciesGUI.exe
将所有丢失的.dll
文件下载并粘贴到../system32/
. 然后检查错误消息是否消失/更改。但是,.dll
报告丢失的文件之一是:api-ms-win-core-wow64-l1-1-1.dll
我还没有找到(在线)。此外,我试图欺骗复制并重命名api-ms-win-core-wow64-l1-1-0.dll
为,api-ms-win-core-wow64-l1-1-1.dll
但(幸运的是)无法dpendenciesGUI.exe
识别.dll
找到的文件。
如何使 python 的错误消息/回溯明确提及哪个.dll
文件(第一个.dll
文件)未找到?
这不是解决xy-problem
安装opencv
.
简短的回答:没有。
虽然这可能并非完全不可能,但它需要像dependenciesGUI
Python一样绑定一个工具,以便能够在给定的上下文中调用它(即考虑到 Python 中 dll 的实际搜索路径和已经加载的动态库) . 这将是相当多的工作,但收效甚微。确实,Windows 上 Python>=3.8 中的默认搜索路径应该与其中之一非常相似dependenciesGUI
,这样丢失的 dll 应该是相同的。就我个人而言,我正在为 Python 开发预编译的二进制发行版,到目前为止dependenciesGUI
足以识别 Python 导入时缺少的库。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句