【问题标题】:pip3 install opencv-python error on Raspbianpip3 在 Raspbian 上安装 opencv-python 错误
【发布时间】:2019-09-05 09:54:51
【问题描述】:

我正在尝试使用以下命令 sudo pip3 install opencv-python 安装 opencv-python,但我不断收到以下错误
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none) ERROR: No matching distribution found for opencv-python
我尝试使用命令 pip install --upgrade pip 升级 pip,然后再次尝试安装 opencv-python,但我仍然遇到同样的错误。

【问题讨论】:

  • sudo apt-get install python3-opencv ?
  • Err:1 http://raspbian.raspberrypi.org/raspbian buster/main armhf libpq5 armhf 11.3-1 404 Not Found E: Failed to fetch http://raspbian.raspberrypi.org/raspbian/pool/main/p/postgresql-11/libpq5_11.3-1_armhf.deb 404 Not Found E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
  • 也许像错误消息中所说的那样运行sudo apt-get update
  • Hit:1 http://archive.raspberrypi.org/debian buster InRelease Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB] Reading package lists... Done E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'testing' to 'stable' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
  • 你试过sudo apt update,正如here所建议的那样吗?

标签: python opencv pip raspberry-pi raspbian


【解决方案1】:

这是因为树莓派架构的 pypi 上没有 .whl。你也可以在opencv-pythonREADME on Github的FAQ部分看到这个:

问:Pip 失败,找不到满足要求的版本...?

答:这个问题很可能与太旧的 pip 有关,可以通过运行 pip install --upgrade pip 来修复。请注意,wheel(尤其是 manylinux)格式目前不支持正确的 ARM 架构,因此 PyPI 中没有基于 ARM 的平台的包。但是,可以从https://www.piwheels.org/ 找到适用于 Raspberry Pi 的 opencv-python 包。

如果您遇到任何问题,应始终查看这些页面以了解其他依赖项或特殊架构的安装说明。

请注意,您可以通过访问Pypi page 然后选择Homepage 按钮快速到达那里

【讨论】:

  • 当我执行安装opencv 的命令时,它会说它的Looking for indexes: https://pypi.org/simple, https://piwheels.org/simple,这意味着pip.confextra-index-url=https://www.piwheels.org/simple
  • 你有哪个 raspberry-pi(和 python 版本)?
  • Rasberry-pi 4 (Python 2.7.16)
  • 我查看了piwheels.org/simple/opencv,但该网站上没有opencv 或任何内容的链接。
  • 那是因为您尝试安装的包是opencv-python,它可用但不适用于python 2.7。看起来你要么自己编译要么使用apt进行安装@
猜你喜欢
  • 2020-07-30
  • 2019-12-04
  • 2019-12-10
  • 1970-01-01
  • 2017-03-16
  • 2021-01-05
  • 1970-01-01
  • 1970-01-01
  • 2018-09-09
相关资源
最近更新 更多