AttributeError: 'module' object has no attribute '_base'
2017-02-21 18:49
781 查看
较为完整的错误信息是:
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'
大概就是说html5lib里面的treebuilders里面没有_base这个属性(其实就是找不到 _base 这个文件)
stackoverflow上查了很多种说法,有的说更新beautiful soup或者html5lib,有的说必须html5lib <= 0.999999
但是我的html5lib是刚下载的,就是这个版本(好像多了2个9...)
后来问了同事,发现只要去html5lib这个文件夹里(pip install的文件),找到treebuilders这个文件夹,然后看到里面的确没有_base.py。而是有一个base.py。我就把base.py前面加了一个_,改为_base.py。然后关掉sublime,再打开运行,就可以了!!!
以后'module' object has no attribute (貌似经常见到)都可以用这个思路找找原因。
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'
大概就是说html5lib里面的treebuilders里面没有_base这个属性(其实就是找不到 _base 这个文件)
stackoverflow上查了很多种说法,有的说更新beautiful soup或者html5lib,有的说必须html5lib <= 0.999999
但是我的html5lib是刚下载的,就是这个版本(好像多了2个9...)
后来问了同事,发现只要去html5lib这个文件夹里(pip install的文件),找到treebuilders这个文件夹,然后看到里面的确没有_base.py。而是有一个base.py。我就把base.py前面加了一个_,改为_base.py。然后关掉sublime,再打开运行,就可以了!!!
以后'module' object has no attribute (貌似经常见到)都可以用这个思路找找原因。
相关文章推荐
- AttributeError: 'module' object has no attribute '_base' 可行解决办法
- [置顶] AttributeError: 'module' object has no attribute '_base' 可行解决办法
- AttributeError: 'module' object has no attribute '_base' 可行解决办法
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'Spider' 解决了
- web.py 启动时候出现AttributeError: 'module' object has no attribute 'inet_pton'错误
- AttributeError: 'module' object has no attribute 'text_format'
- AttributeError: 'module' object has no attribute 'face' 问题解决 opencv+python
- AttributeError: 'module' object has no attribute 'urlopen'
- python AttributeError: 'module' object has no attribute 'dumps'解决办法
- AttributeError: 'module' object has no attribute 'text_format'
- AttributeError: ‘module’ object has no attribute’xxx 问题解决
- AttributeError: 'module' object has no attribute 'histogram_summary'
- 导入Beautifulsoup 报错 AttributeError: 'module' object has no attribute '_base'
- AttributeError: 'module' object has no attribute 'text_format'
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- 【TensorFlow问题】AttributeError:'module' object has no attribute 'mul'
- AttributeError: 'module' object has no attribute 'cross_validation'
- AttributeError: 'module' object has no attribute 'text_format'
- 解决Python报错: AttributeError: 'module' object has no attribute '_base'