pip install 找不到我安装的最高版本 python

pip install doesn't find my highest installed version of python

我的问题是,当我尝试安装需要 python >= 3.7 的产品时,安装程​​序失败,提示找不到所需的 python 版本,即使我这样做了安装了 python 3.8。

我 运行宁 Ubuntu Windows 10(MS 商店产品。)

它安装了 python 3.6。

从干净的 ubuntu 安装,我

sudo apt update
sudo apt install python3.8
sudo apt install python3-pip

此时命令 "python" 未映射(不可用),但我可以 运行 "python3" 获取 python3.6 或 "python3.8"得到那个版本。 pip3 报告它正在使用 python 3.6。

pip3 --version 
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

所以 pip 似乎无法识别我拥有的 python 3.8。

当我尝试安装我的产品时,它失败了,表明

sudo pip3 install --verbose (mypackage name)
(... various messages...)
(requires-python:>=3.7) is incompatible with the pythonversion in use. Acceptable python versions are:>=3.7
Could not find a version that satisfies the requirement cbordplatform (from versions: )
No matching distribution found for (my package name)

如何让 pip3 识别我的 python3.8?

如果你想 确定 pip 使用的是正确版本的 Python,请使用特定的 Python 调用它,如下所示:

python3.8 -m pip ...