2016-09-06 3 views
0

저는 파이썬과 팬더에 새로운 것이므로 간단한 실수를 저지를 수 있습니다.pandas read_html 함수를 사용하려고 할 때 오류가 발생했습니다.

import quandl 
import pandas as pd 

df3 = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states') 
print(df3) 

내가 설치 한 팬더뿐만 아니라 PIP를 통해 quandl :

나는 아래의 코드를 실행하기 위해 노력하고있어. 나는 다음과 같은 오류 얻을 코드를 실행하면 :

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 

내가 다음 명령 프롬프트 핍을 통해 lxml이 설치 시도하고 내가 몇 가지 오류가있어 :

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 

심지어에서이에 대한 제안을 시도를 this thread :

같은

"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."

로제안 된 사이트에서 whl 파일을 다운로드했지만 설치하지 못했습니다. 나는 pip를 사용하고 파일의 이름을 타이핑하려고 시도했지만 파일은 pip를 통해 인식되지 않습니다. 당신이 도움을

파이썬 2.7 및 Windows 7 전문

감사를 사용하고 있습니다.

+0

pip와 함께 'whl' 파일을 설치하려고하면 메시지가 반환됩니까? – gabra

+0

그리고 [이] (http://stackoverflow.com/q/27885397/2029132)를 보았습니까? – gabra

+1

문제가 해결되었습니다. 파일이 내 사용자 이름의 디렉토리에 있었을 때 "다운로드"에서 "LocalDisk/Users/myname"으로 파일을 옮겼습니다. PIP가 파일을 찾아서 설치할 수있었습니다. 답변 해 주셔서 감사합니다. – Moondra

답변

0

문제가 해결되었습니다. 설치하고 싶은 파일을 Downloads에서 LocalDisk/Users/My_name으로 옮겼습니다. 올바른 디렉토리에서 PIP은 어떤 이유로 든 찾아서 설치할 수있었습니다. 답변 주셔서 감사합니다.

관련 문제