构建 cv2 后,cv2 未导入
所以我使用 这个 指南几乎完全“完全”遵循它。但是当我尝试 import cv2
时,我收到此错误:
ModuleNotFoundError: No module named 'cv2'
我害怕使用 pip 来安装 OpenCV,担心它会安装基于 CPU 的 OpenCV。我需要做什么才能让 python 看到我手动构建的?也许与简历不在路径中有关?
仅供参考,我没有从我使用 Microsoft 商店的网站安装 python。我安装了Python 3.10
So I manually built OpenCV using this guide and followed it almost exactly "to the T" besides using a newer version of CUDA and CUDNN. But when I try to import cv2
I get this error:
ModuleNotFoundError: No module named 'cv2'
I'm afraid to use pip to install OpenCV afraid it will install it's CPU based OpenCV. What do I need to do to get python to see I manually built? Maybe something to do with CV not being in the PATH?
Just FYI I did not install python from the site I used the Microsoft store. And I installed Python 3.10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是在 Windows 10 上的 anaconda 环境上构建支持 cuda 的 open-cv 的官方手册 - 我希望它能有所帮助。另外,最后我还添加了 open-cv 的存根(手动构建后,IDE 内没有自动完成功能,添加存根将修复它)
函数的输出:
This is not an official manual to build open-cv with cuda support on anaconda envioroment on windows 10 - I hope it'll help. Also, at the end I also added stubs for open-cv (after manual build there is no auto complete inside the IDE, adding the stubs will fix it)
Output of the function: