突然发现草稿箱里面还有一篇之前写的东西,顺手发出来给新学习的同学分享
方法一:如果电脑可以联网的话,直接使用pip安装
C:\Python38\Lib\site-packages>pip3 install openpyxl
Collecting openpyxl
Downloading https://files.pythonhosted.org/packages/0d/75/d962c445610131dd3e28
85e7e1fc9432848dc85a131fbdfa8b5b51dafce7/openpyxl-2.5.6.tar.gz (173kB)
41% |█████████████ | 71kB 510kB/s eta 0:00:01
47% |███████████████ | 81kB 583kB/s eta 0:00:
52% |█████████████████ | 92kB 590kB/s eta 0:0
58% |███████████████████ | 102kB 504kB/s eta
64% |█████████████████████ | 112kB 504kB/s et
70% |██████████████████████▌ | 122kB 729kB/s
76% |████████████████████████▌ | 133kB 729kB/
82% |██████████████████████████▌ | 143kB 820k
88% |████████████████████████████ | 153kB 937
94% |██████████████████████████████ | 163kB 8
100% |████████████████████████████████| 174k
B 820kB/s
Collecting jdcal (from openpyxl)
Downloading https://files.pythonhosted.org/packages/a0/38/dcf83532480f25284f3e
f13f8ed63e03c58a65c9d3ba2a6a894ed9497207/jdcal-1.4-py2.py3-none-any.whl
Collecting et_xmlfile (from openpyxl)
Downloading https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad
9fb36f64c1c1f04216f41797f2f0fa567da11388/et_xmlfile-1.0.1.tar.gz
Installing collected packages: jdcal, et-xmlfile, openpyxl
Running setup.py install for et-xmlfile … done
Running setup.py install for openpyxl … done
Successfully installed et-xmlfile-1.0.1 jdcal-1.4 openpyxl-2.5.6
*PS:
默认的pip install 会从python.org官网下载,速度很慢
可以使用下面的镜像网站,安装速度飞快
pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com 模块名
国内镜像网站:
豆瓣(douban) http://pypi.douban.com/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
方法二:下载安装包安装
https://pypi.org/
安装包分为两种File type:
2.1 Wheel安装方式
pip install pythonnet-2.5.2-cp38-cp38-win_amd64.whl
2.2 Sourcel安装方式
cd C:\Python38\Lib\site-packages\openpyxl-3.0.9.tar\openpyxl-3.0.9
python setup.py install