pip install lxml 出错
pip install lxml
Collecting lxml
Using cached lxml-5.2.2.tar.gz (3.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
<string>:67: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
Building lxml version 5.2.2.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
解决方法:
看错误提示:Please make sure the libxml2 and libxslt development packages are installed.
要先安装libxml2和libxslt这两个package
pkg install libxml2 -y
pkg install libxslt
安装后,再运行pip install lxml
问题解决