问题描述:在vscode中利用conda 安装 cv2报错
报错如下:Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- cv2
Current channels:
解决
方案一
conda config --add channels conda-forge
conda config --add channels anaconda.org文章来源:https://www.toymoban.com/news/detail-777751.html
- 结果:报错如下
HTTP 404 NOT FOUND for channel anaconda.org https://conda.anaconda.org/anaconda.org
The channel is not accessible or is invalid.
方案二
conda config --remove-key channels
pip install opencv-python文章来源地址https://www.toymoban.com/news/detail-777751.html
- 结果 :
Successfully installed opencv-python-4.9.0.80
- 总结:安装cv2 时使用如下命令
pip install opencv-python
- 使用时:import cv2 as cv
到了这里,关于python 安装 cv2报错 conda install PackagesNotFoundError的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!