0

I can't install lxml on pip or pip3

I tried run the code on python3.11

import pandas as pd
data = pd.read_html("https://zh.wikipedia.org/zh-hans/%E6%81%92%E7%94%9F%E6%8C%87%E6%95%B8")

It occurred a Import Error. "ImportError: lxml not found, please install it"

So I tried to install the lxml. "pip install lxml"

However, it cannot be install. ** note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> lxml

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.**

And then, I had download the lxml-4.9.9-pp38-....whl and entered "pip install c:/......." and it said whl is not a supported wheel on this platform.

Could someone do me a favor?

  • Does this answer your question? [Installing lxml module in python](https://stackoverflow.com/questions/4598229/installing-lxml-module-in-python) – hlin03 Dec 07 '22 at 11:15
  • 1
    Thank you. I have found the reason. lxml does not support for python 3.11, so I setup version 3.9. – Jeffrey Mak Dec 07 '22 at 13:43

0 Answers0