1

我在虚拟环境中运行 Python,并且在其中执行以下操作:

python -V

返回:

Python 3.9.5

然后我运行:

pip install opencv-contrib-python

并得到:

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
ERROR: Could not find a version that satisfies the requirement opencv-contrib-python
ERROR: No matching distribution found for opencv-contrib-python

如果我已经在最新的 Python 上,我需要运行哪些命令才能安装 opencv?

4

1 回答 1

1

我刚碰到这个。看起来是因为您的虚拟环境正在使用来自 python3.5 的 pip

这是我收到的信息:

来自 /home/user/virtproj/lib/python3.5/site-packages/pip 的 pip 20.3.4(python 3.5)

这可能是您的解决方案:

python3 -m venv --升级 ENV_DIR

ENV_DIR= 您安装环境的目录。

在 virtualenv 中升级 python

于 2021-09-25T02:51:49.777 回答