【问题标题】:pip install doesn't find my highest installed version of pythonpip install 找不到我安装的最高版本的python
【发布时间】:2020-04-14 18:56:51
【问题描述】:

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

我正在运行适用于 Windows 10 的 Ubuntu(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?

【问题讨论】:

    标签: python-3.x linux pip windows-subsystem-for-linux


    【解决方案1】:

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

    python3.8 -m pip ...
    

    【讨论】:

      猜你喜欢
      • 2021-10-13
      • 2016-06-30
      • 1970-01-01
      • 2021-03-25
      • 1970-01-01
      • 2015-12-17
      • 1970-01-01
      • 2020-07-17
      • 2021-09-14
      相关资源
      最近更新 更多