Python中如何用命令行的方式安装lxml库
在用python进行爬虫时,运行程序之后,会显示如下错误:
bs4.FeatureNotFound:Couldn’t find a tree builder with the features you requests
错误的原因是没有安装lxml库
1 在命令行中输入pip install lxml
pip install lxml
未能成功安装lxml库
2 解决方案:
在命令行中输入:
pip install lxml -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip install lxml -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
即可成功安装lxml库