1 在conda终端,使用python3.7时,用pip安装openpyxl出现如下错误:

使用 pip3 install openpyxl 也不行。
2 在windows终端(winodows+R,输入cmd)使用 pip 或pip3安装也不行。
在使用 python -m pip install --upgrade pip 升级pip包之后再重新安装也还是不行。
3 根据 Pycharm中File -> Settings… -> Project:xxx -> Python Interpreter的搜索框中搜索openpyxl并选中进行安装会出现如下
问题:
“Could not find a version that satisfies the requirement openpyxl” ,在details里面并给出了两行提示代码,其中一行是激活python所在的环境,rs为环境名。conda activate C: Users\admin\miniconda3\envs\rs
4 我看到网上说是因为因为国内连接外网容易出现数据中断,网络差导致的。就想到先将环境激活,再使用国内豆瓣镜像去安装,这样应该可以了。
在conda终端,先激活环境,在使用国内豆瓣镜像可成功安装。代码如下:
先输入 conda activate C: Users\admin\miniconda3\envs\rs ,回车
再输入 pip install openpyxl -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com,回车,等待安装完成。
参考链接:(2条消息) Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )_My木岩的博客-CSDN博客_pip3和pip的区别
Python出现Could not find a version that satisfies the requirement openpyxl (from versions: ) - 灰信网(软件开发博客聚合) (freesion.com)