lxml是什么:
lxml是个非常有用的python库,它可以灵活高效地解析xml,与BeautifulSoup、requests结合,是编写爬虫的标准姿势。
方法1:
打开cmd
输入pip install lxml
如果能够成功是最好的,可能现在打开pycharm还没有lxml,就选择lxml上的红灯泡选择导入就可以了
我之前可能有一点没有说清楚
安装lxml前需要先安装一下wheel
pip install wheel

方法2:
打开cmd
输入: pip install wheel
然后从官网下载相对应的lxml版本,我使用的是python3.7版本


然后cmd中转到下载的文件夹中
输入: pip install lxml-4.3.3-cp37-cp37m-win_amd64.whl
安装成功
可能现在打开pycharm还没有lxml,就选择lxml上的红灯泡选择导入就可以了

我看评论好像都安装不了,那这还有一个方法,如果使用的是pycharm的话,可以直接使用pycharm下载
我先把我装好的lxml删除示范一下

现在py文件中已经不能使用lxml了

打开pycharm的设置




包正在安装中

安装成功


推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/3346.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
打赏

微信支付宝扫一扫,打赏作者吧~
休息一下~~