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)