ubuntu下 安装python版本对应的pip

  • 问题 在使用pip安装python包时, 有时会报错如下:

      Cannot fetch index base URL https://pypi.python.org/simple/
      Could not find any downloads that satisfy the requirement
    
  • 原因: pip版本过低

  • 解决方法:
    1 使用pip升级: python -m pip install --upgrade pip
    2 使用脚本get-pip.py 升级 (可以指定你python版本支持的pip,这里我使用的时python3.5)
    下载get-pip.py 脚本 wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
    执行 python3 get-pip.py(我本地双python所以这样就默认pip配置成python3 的版本) 默认python版本使用 python get-pip.py

  • 参考: https://pip.pypa.io/en/latest/installation/#get-pip-py

posted @ 2022-09-15 16:39  鲁zzz  阅读(541)  评论(0编辑  收藏  举报