pandas read_html execution error, importError: lxml not found

Asked 2 years ago, Updated 2 years ago, 39 views

Hello, I am a beginner developer who is studying Python. I was doing an example to retrieve stock information, but an error occurred in read_html I don't know the cause.

Masters, please help me.

import pandas as pd

df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download', header=0)[0]
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download', header=0)[0]
  File "C:\Users\Kang Seung-won\AppData\Local\Packages\PythonSoftwareFoundation.Python3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\hml.py", line 1085, in read_html
    return _parse(
  File "C:\Users\Kang Seung-won\AppData\Local\Packages\PythonSoftwareFoundation.Python3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\hml.py", line 891, in _parse
    parser = _parser_dispatch(flav)
  File "C:\Users\Kang Seung-won\AppData\Local\Packages\PythonSoftwareFoundation.Python3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\hml.py", line 848, in _parser_dispatch
    raise ImportError("lxml not found, please install it")
ImportError: lxml not found, please install it

python pandas

2022-09-20 21:39

1 Answers

pip install lxml


2022-09-20 21:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.