Python使用技巧(五):快速解决安装python-lxml模块库报错问题并简单使用

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文件内容在这里插入图片描述
具体教程看代码说明:
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

源代码杀手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值