beautifulsoup, html5lib: module object has no attribute _base

前端 未结 8 2145
逝去的感伤
逝去的感伤 2020-12-04 18:57

When I updated my packages I have this new error:

class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: \'module\' object ha         


        
8条回答
  •  悲哀的现实
    2020-12-04 19:38

    The same problem occurred on me. I don't know what you were trying to do, but it occurred on me when I tried to read XML file in pandas, using pd.read_html().

    The problem is fixed by upgrading all of beautifulsoup4, html5lib, and lxml, like:

    pip install bs4
    pip install html5lib
    pip install lxml
    

    And restart your Python environment and now it is working.

提交回复
热议问题