Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )

镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )

My木岩 2018-12-27 21:29:46 镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: ) 133669 镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: ) 收藏 97

分类专栏: Python 文章标签: pip和pip3区别python运维openxyl

版权

一.环境

使用python3.7时,用pip安装openpyxl出现如下错误:
镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )

  1. 系统环境:windows10家庭版
  2. Python版本:python3.7.1
  3. IDE:sublime_text 3

二. 解决方案

  1. 按照提示所示是其中一个原因是pip版本过低,需要更新pip:
    python -m pip install --upgrade pip
    由于python国内网络不稳定,一直报错,升级了很多次才成功。
  2. 然后继续还是报错:
    镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )
  3. 可能考虑到是python国内网络的问题,这时我们用国内的镜像源来加速。
    pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
    这个是豆瓣源
    --trusted-host pypi.douban.com 这是为了获得ssl证书的认证,要不然会报错镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )
    然而还是报错,可能是我电脑网络原因,常理来说都可以安装成功的,大家到这一步可能应该已经解决问题了。
  4. 我最后还是用pip3 install openpyxl尝试很多次后才安装成功。
    镜像安装Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )

三. pip和pip3的区别

其实这两个命令效果是一样的,没有区别:

  1. 比如安装库openpyxl,pip3 install openpyxl或者pip install openpyxl:只是当一台电脑同时有多个版本的Python的时候,用pip3就可以自动区分用Python3来安装库。是为了避免和Python2发生冲突的。
    (2)如果你的电脑只安装了Python3,那么不管用pip还是pip3都一样的。
  2. 安装了python3之后,会有pip3
    (1)使用pip install XXX :
    新安装的库会放在这个目录下面:python2.7/site-packages
    (2)使用pip3 install XXX :
    新安装的库会放在这个目录下面:python3.7/site-packages
    (3)如果使用python3执行程序,那么就不能importpython2.7/site-packages中的库。

相关文章:

  • 2021-07-29
  • 2021-12-11
  • 2021-12-21
  • 2021-08-29
  • 2021-06-23
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2021-09-24
  • 2021-05-17
  • 2022-12-23
  • 2021-06-19
  • 2021-12-16
相关资源
相似解决方案