解决Python报错: AttributeError: 'module' object has no attribute '_base'
来源:互联网 发布:java iocp 编辑:程序博客网 时间:2024/05/20 03:08
#完整报错File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in <module> class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):AttributeError: 'module' object has no attribute '_base'
方法1
pip install --upgrade html5lib==1.0b8
方法2
vi /usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py 70Gclass TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder)
需要加载_base.py文件,而这个文件在/usr/local/lib/python2.7/dist-packages/html5lib/treebuilders下没有,
把base.py换成_base.py
更新一下ok!
后记
以前经常遇到这种问题只是一味的Google,没有认真分析原因,及时解决了也无法知道其中的原理,得到一个教训:报错先看源码,再解决,行不通再去google!
阅读全文
0 0
- 解决Python报错: AttributeError: 'module' object has no attribute '_base'
- AttributeError: 'module' object has no attribute '_base'
- 导入Beautifulsoup 报错 AttributeError: 'module' object has no attribute '_base'
- 导入Beautifulsoup 报错 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 '_base' 可行解决办法
- import module报错AttributeError: 'module' object has no attribute
- python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
- 报错AttributeError: 'module' object has no attribute 'HTTPSConnection'
- 报错 AttributeError: 'module' object has no attribute 'bool_'
- Tensorflow报错:AttributeError: 'module' object has no attribute 'summary'
- 【Tensorflow】报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- Tensorflow报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- pandas报错AttributeError: 'module' object has no attribute 'plotting'
- tensorflow报错:AttributeError: 'module' object has no attribute 'get_or_create_global_step'
- Python脚本报错AttributeError: ‘module’ object has no attribute ’urllibopen'(Python 2.7.11 )
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- 幂运算求解(高效率)
- 远征expedition
- java修饰符小结
- Java基础知识总结
- 基于高光谱影像的农作物检测应用简介
- 解决Python报错: AttributeError: 'module' object has no attribute '_base'
- JZOJ 5396. 【NOIP2017提高A组模拟10.6】Blocks
- 数据结构-矩阵
- 驱动开发入门
- 2017-10-6有感
- 二分查找的非递归实现
- Spring入门(AspectJ,Advice以及对于Advice扩展)
- java入门IO流--FileOutputStream&&FlieInputStream
- 数组中第K小的数