如题,通过 conda install opencv
然后遇到
ImportError: DLL load failed while importing cv2: 找不到指定的模块。
参考网络相关答案
通过conda 卸载
然后通过 pip3 安装opencv-pyhton
https://stackoverflow.com/questions/75387197/anaconda-importerror-dll-load-failed-while-importing-cv2-the-specified-module
然后还是遇到报错
Error || `ERROR: These packages do not match the hashes from the requirements file
参考
https://blog.csdn.net/weixin_61514920/article/details/139238042
https://zhuanlan.zhihu.com/p/438709381
尝试
pip cache purge
pip3 install opencv-python==4.10.0.82 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
成功 自此成功导入
回顾,之前都是通过 conda install 的包
第二天发现from matplotlib import pyplot as plt
也开始报错了
提示 ImportError: DLL load failed while importing _imaging: 找不到指定的模块
参考了
https://tencentcloud.csdn.net/67876a73edd0904849a53965.html
和上面的问题一样 卸载 matplitlib 然后通过 pip 重新下载
然后出现报错
ModuleNotFoundError: No module named ‘PIL’
然后
其实就是卸载当前的PIL 然后重新下载对应版本的
我的是python 3.10
pip install pillow==8.3.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
顺利运行