python 安装 cv2报错 conda install PackagesNotFoundError

问题描述:在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

conda config --remove-key channels

pip install opencv-python

  • 结果 :
    Successfully installed opencv-python-4.9.0.80
  • 总结:安装cv2 时使用如下命令
  • pip install opencv-python
  • 使用时:import cv2 as cv
相关推荐
yangshicong几秒前
第19章:AI安全防护与AI安全
人工智能·python·安全·prompt·ai编程
果汁华2 分钟前
Function Calling 与 Python 实战完整指南
开发语言·网络·python
c_lb728814 分钟前
2026年不同基础做量化,先找AI能参与的位置
人工智能·python
小小晓.20 分钟前
C++:语句和作用域
开发语言·c++
wanderist.1 小时前
Lambda表达式在算法竞赛中的应用
java·开发语言·算法
chenment2 小时前
ComfyUI 自定义节点开发:从零扩展你的图像生成工作流
python·stable diffusion
海天鹰2 小时前
PHP上传文件
android·开发语言·php
互联网中的一颗神经元3 小时前
小白python入门 - 25. SQL 与表设计入门
数据库·python·sql
Yeauty4 小时前
渲染成图再 CLI 拼接,还是进程内直推?Rust 帧到视频的两条路
开发语言·rust·音视频
geovindu4 小时前
CSharp: Breadth First Search Algorithm and Depth First Search Algorithm
开发语言·后端·算法·c#·.net·搜索算法