【发布时间】:2016-04-05 22:33:16
【问题描述】:
我正在尝试从 wiki URL 中提取美国各州,为此我正在使用 Python Pandas。
import pandas as pd
import html5lib
f_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
但是,上面的代码给了我一个错误 L
ImportError Traceback(最近一次调用最后一次) 在 () 1 将熊猫作为 pd 导入 ----> 2 f_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
如果风味在 ('bs4', 'html5lib'): 如果不是 _HAS_HTML5LIB,则为 662: --> 663 raise ImportError("html5lib not found, please install it") 如果不是 _HAS_BS4,则为 664: 665 raise ImportError("BeautifulSoup4 (bs4) not found, please install it") ImportError: 找不到 html5lib,请安装它
我也安装了 html5lib 和 beautifulsoup4,但它不起作用。 有人可以帮忙吗?
【问题讨论】: