unlessplus 2022-11-06 21:48 采纳率: 50%
浏览 996
已结题

opencv-python>=4.1.2 not found 报错处理

在跑yolov5s之前出现这个opencv-python的问题

github: skipping check (not a git repository)
requirements: opencv-python>=4.1.2 not found and is required by YOLOv5, attempting auto-update...
ERROR: Invalid requirement: "'opencv-python"
Traceback (most recent call last):
File "D:\yolov5-5.0\utils\general.py", line 110, in check_requirements
pkg.require(r)
File "D:\anaconda\envs\pytorch\lib\site-packages\pkg_resources_init.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
File "D:\anaconda\envs\pytorch\lib\site-packages\pkg_resources_init
.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'opencv-python>=4.1.2' distribution was not found and is required by the application**

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\yolov5-5.0\train.py", line 500, in
check_requirements()
File "D:\yolov5-5.0\utils\general.py", line 114, in check_requirements
print(subprocess.check_output(f"pip install '{e.req}'", shell=True).decode())
File "D:\anaconda\envs\pytorch\lib\subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\anaconda\envs\pytorch\lib\subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'pip install 'opencv-python>=4.1.2'' returned non-zero exit status 1.

但是我的pycharm里面显示的是我的版本是4.5.5

img

这个怎么解决呀

  • 写回答

7条回答 默认 最新

  • FriendshipT 2022-11-06 22:03
    关注

    你确定你运行的环境是这个(图里的红框)吗?

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

问题事件

  • 系统已结题 11月15日
  • 已采纳回答 11月7日
  • 创建了问题 11月6日

悬赏问题

  • ¥15 带序列特征的多输出预测模型
  • ¥15 VB.NET读取电脑主板序列号
  • ¥15 Python 如何安装 distutils模块
  • ¥15 关于#网络#的问题:网络是从楼上引一根网线下来,接了2台傻瓜交换机,也更换了ip还是不行
  • ¥15 资源泄露软件闪退怎么解决?
  • ¥15 CCF-CSP 2023 第三题 解压缩(50%)
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错