与BeauitfoulSoup一起使用lxml时出错

时间:2016-12-24 09:44:45

标签: python beautifulsoup lxml

我正在尝试使用BeautifoulSoup在我的eclipse项目中使用lxml解析器:

bsObj = BeautifulSoup(html,'lxml')

我跑了:STATIC_DEPS=true pip install lxml --user并得到了结果:Successfully installed lxml-3.7.1

由于我收到错误,我的计算机似乎无法识别lxml解析器:

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

知道我错过了什么吗?

我是OSX,安装了python3和python2x版本。

1 个答案:

答案 0 :(得分:0)

运行pip3 install --upgrade pippip install --upgrade pip)后运行不够,STATIC_DEPS=true pip3 install lxml --user lxml解析器正常运行。