I'm really new to python and pandas so I could be making a simple mistake.
I'm trying to run the code below:
import quandl
import pandas as pd
df3 = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
print(df3)
I have installed pandas as well quandl through pip. When I run the code I get the following error:
Traceback (most recent call last):
File "C:\Python27\FunwithQuandl.py", line 14, in <module>
df3 = pd.read_html('https://simple.wikipedia.org /wiki/List_of_U.S._states')
File "C:\Python27\lib\site-packages\pandas\io\html.py", line 874, in read_html
parse_dates, tupleize_cols, thousands, attrs, encoding)
File "C:\Python27\lib\site-packages\pandas\io\html.py", line 726, in _parse
parser = _parser_dispatch(flav)
File "C:\Python27\lib\site-packages\pandas\io\html.py", line 685, in _parser_dispatch
raise ImportError("lxml not found, please install it")
ImportError: lxml not found, please install it
I then tried installing lxml via command prompt and pip and I got a few errors:
Cannnot open include file: 'libxml/xpath.h': No such file or directory
Could not find function xmlCheckVersion in library libxm12. Is libxml2 installed?
error: command 'CL\\User\\...Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
I even tried suggestions on this from this thread:
such as
"install lxml from lfd.uci.edu/~gohlke/pythonlibs/#lxml for your python version. It's a precompiled WHL with required modules/dependencies.
The site lists several packages, when e.g. using Win32 Python 2.7, use lxml-3.6.1-cp27-cp27m-win32.whl."
I have downloaded the whl file from the site suggested but I can't seem to install it. I have tried using pip and typing out the name of the file but the file isn't being recognized via pip.
I am using Python 2.7 and Windows 7 professional
Thanks for you help.