统信UOS安装python-docx遇到的困难
**前言:**本文默认你的国产系统(通信)已经可以使用pip3,貌似pip不可以直接用
如果你pip3不能使用,移步知乎大佬或者直接百度
> https://zhuanlan.zhihu.com/p/443304282
正文
直接安装python-docx出现的问题如下:
- 1.具体报错忘记保存了,它说要先安装lxml库,然后我就着手呗
出现下面问题:
Collecting lxml
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/84/74/4a97db45381316cd6e7d4b1eb707d7f60d38cb2985b5dfd7251a340404da/lxml-4.7.1.tar.gz
Complete output from command python setup.py egg_info:
Building lxml version 4.7.1.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
----------------------------------------
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-q5nyly9f/lxml/
- 2.Please make sure the libxml2 and libxslt development packages are installed.
所以我就去安装这libxml2 和 libxslt 两个库
- 3.结果你猜怎么着。诶!!当然是失败啦
具体报错:
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.tuna.tsinghua.edu.cn/simple/libxml2/
另外一个库也是如此相同的报错,到底是怎么回事呢,这个环境错误???
然后看了很多帖子之后发现可能是要升级pip库了,你说离谱不离谱
1.更新pip
pip3 install --user --upgrade pip
2.安装lxml
pip3 install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple
3.python-docx
pip3 install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simple
4.撒花,终于可以着手识别那些公文标题然后作为文件名称了!!!哈哈哈哈哈哈哈哈哈哈