ubuntu18.04搭建pytorch环境中遇到的报错:Requirement already satisfied 的解决办法

ubuntu18.04搭建pytorch环境中遇到的报错:Requirement already satisfied 的解决办法

运行代码时,报错 NO module named cv2
在这里插入图片描述
在命令行输入pip install opencv-python时报错Requirement already satisfied: opencv-python 上文这里插入图片描述
本想在anaconda3的pytorch中安装opencv,却报错anaconda中自带的python3.8已经安装了opencv。在网上搜了很多方法,最后参考一篇文章中的方法成功解决了问题,非常感谢博主。

文章链接: https://blog.csdn.net/Annaluo/article/details/113558886.

没有安装成功其实就是路径不正确,所以安装的时候要指定具体的路径。

//参考代码
pip install --target=ubuntu/python3.8/site-packages opencv-python

查询opencv版本,显示安装成功
在这里插入图片描述
如果需要安装其他包也可以使用这种方法,亲测有效。

你可能感兴趣的:(深度学习,神经网络,ubuntu,pytorch,python)