I encounter this error when trying to read a table from url (link here).
Here is the code:
import pandas as pd
link = "http://www.checkee.info/main.php?dispdate="
c=pd.read_html(link)
The error returned is: AttributeError: 'module' object has no attribute '_base'
Specifically
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-5e6036f08795> in <module>()
1 link = "http://www.checkee.info/main.php?dispdate="
----> 2 c=pd.read_html(link)
/Users/lanyiyun/anaconda/lib/python2.7/site-packages/pandas/io/html.pyc in read_html(io, match, flavor, header, index_col, skiprows, attrs, parse_dates, tupleize_cols, thousands, encoding)
859 pandas.read_csv
860 """
--> 861 _importers()
862
863 # Type check here. We don't want to parse only to fail because of an
/Users/lanyiyun/anaconda/lib/python2.7/site-packages/pandas/io/html.pyc in _importers()
40
41 try:
---> 42 import bs4 # noqa
43 _HAS_BS4 = True
44 except ImportError:
/Users/lanyiyun/anaconda/lib/python2.7/site-packages/bs4/__init__.py in <module>()
28 import warnings
29
---> 30 from .builder import builder_registry, ParserRejectedMarkup
31 from .dammit import UnicodeDammit
32 from .element import (
/Users/lanyiyun/anaconda/lib/python2.7/site-packages/bs4/builder/__init__.py in <module>()
312 register_treebuilders_from(_htmlparser)
313 try:
--> 314 from . import _html5lib
315 register_treebuilders_from(_html5lib)
316 except ImportError:
/Users/lanyiyun/anaconda/lib/python2.7/site-packages/bs4/builder/_html5lib.py in <module>()
68
69
---> 70 class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
71
72 def __init__(self, soup, namespaceHTMLElements):
AttributeError: 'module' object has no attribute '_base'
Anyone knows what the problem causes this? Thanks!