beautifulsoup won't recognize lxml

后端 未结 2 1375
眼角桃花
眼角桃花 2020-12-16 15:05

I\'m attempting to use lxml as the parser for BeautifulSoup because the default one is MUCH slower, however i\'m getting this error:

    soup =          


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-16 15:40

    It looks like lxml has not been successfully installed. To install lxml on Ubuntu, run

    sudo apt-get install libxslt1-dev libxml2
    

    In virtualenv:

    pip install --upgrade lxml
    pip install cssselect
    

提交回复
热议问题