python-lxml不能安装:
(py-gpu) PS D:python -m pip install lxml
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting lxml
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c9/a0/67f5435f19d0817bdc313782a5aa8442984cf49acc126697c8036ac25299/lxml-4.6.2-cp37-cp37m-win_amd64.whl (3.5 MB)
|██████ | 634 kB 23 kB/s eta 0:02:01ERROR: Exception:
Traceback (most recent call last):
File "D:\Users\\Anaconda3\envs\py-gpu\lib\site-packages\pip\_vendor\urllib3\response.py", line 437,
in _error_catcher
yield
File "D:\Users\Anaconda3\envs\py-gpu\lib\site-packages\pip\_vendor\urllib3\response.py", line 519,
in read
使用清华镜像源,也报错。最终,选择豆瓣镜像安装成功:
安装命令:
python -m pip install lxml --index-url https://pypi.douban.com/simple
执行结果:
Looking in indexes: https://pypi.douban.com/simple
Collecting lxml
Downloading https://pypi.doubanio.com/packages/c9/a0/67f5435f19d0817bdc313782a5aa8442984cf49acc126697c8036ac25299/lxml-4.6.2-cp37-cp37m-win_amd64.whl (3.5 MB)
|████████████████████████████████| 3.5 MB 656 kB/s
Installing collected packages: lxml
Successfully installed lxml-4.6.2
示例:lxmlwe文件内容
具体教程看代码说明: