无法安装 opencv-contrib-python 弃用 Python 3.5

Unable to install opencv-contrib-python deprecation Python 3.5

我 运行宁 Python 在虚拟环境中,我在其中做:

python -V

哪个returns:

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?

我只是 运行 喜欢这个。看起来是因为您的虚拟环境正在使用来自 python3.5

的 pip

这是我收到的消息:

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

这可能是您的解决方案:

python3 -m venv --upgrade ENV_DIR

ENV_DIR=您安装环境的目录。

Upgrade python in a virtualenv