简体   繁体   English

尝试在 Windows 10 上使用 pip 安装 opencv-python 时出错

[英]Error while attempting to install opencv-python using pip on Windows 10

I have been trying to install opencv for Python 3.8.0 on fresh install of Windows 10. Here is the command I ran:我一直在尝试在全新安装 Windows 10 时为 Python 3.8.0 安装 opencv。这是我运行的命令:

C:\Windows\system32>py -m pip install opencv-python

However, I was met with this error:但是,我遇到了这个错误:

ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)
ERROR: No matching distribution found for opencv-python

I have tried:我努力了:

  • Running the command prompt as admin以管理员身份运行命令提示符
  • Upgrading pip using py -m pip install --upgrade pip使用py -m pip install --upgrade pip
  • Checking to make sure I was able to install other libraries with pip.检查以确保我能够使用 pip 安装其他库。 (I tried discord.py and Pillow , all worked) (我试过discord.pyPillow ,一切正常)

opencv-python is a collection of pre-built whl files, as you can see in the project description on the pypi page : opencv-python是预构建的whl文件的集合,您可以在pypi 页面上的项目描述中看到:

OpenCV on Wheels车轮上的 OpenCV

Unofficial pre-built OpenCV packages for Python.用于 Python 的非官方预构建 OpenCV 包。

And is the case for many modules currently, there are no whl files for python 3.8 in that project.目前许多模块都是这种情况,该项目中没有 python 3.8 的 whl 文件。

So simply install a different python version and try again with所以只需安装一个不同的 python 版本,然后再试一次

pip install opencv-python

or或者

download the whl for python 3.8 from here and then do这里下载 python 3.8 的 whl 然后执行

pip install opencv_python‑4.1.2‑cp38‑cp38‑win_amd64.whl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM