分享:当pip 无法安装openpyxl模块时......
python中 openpyxl是解析 .xlsx 文件的模块,一般使用pip install openpyxl 就可以安装。
[h_pw@localhost ~]$ sudo pip install openpyxl [sudo] h_pw 的密码: Collecting openpyxl Downloading https://files.pythonhosted.org/packages/e5/0a/e0a095149a23cedd9c8db6cdde2af7f82105e219e14edea0c31a19aeff9e/openpyxl-2.5.8.tar.gz (1.9MB) 100% |████████████████████████████████| 2.0MB 303kB/s Collecting jdcal (from openpyxl) Downloading https://files.pythonhosted.org/packages/a0/38/dcf83532480f25284f3ef13f8ed63e03c58a65c9d3ba2a6a894ed9497207/jdcal-1.4-py2.py3-none-any.whl Collecting et_xmlfile (from openpyxl) Downloading https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0fa567da11388/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.8
有时,由于权限问题,我们无法使用pip安装,可以去pypi 下载 安装包进行安装。网址是:
在搜索栏输入要查找的模块名字,当然任何已发布的模块你都可以到这里寻找。
提示:
只下载 openpyxl 模块是无法安装成功的,你要先下载安装jdcal, et-xmlfile模块。
安装方法:解压下载的安装包,进入包含setup.py文件的目录,在终端执行命令:python setup.py install
如此,便安装成功。希望对读者有些帮助。
