解决pip install Please make sure the libxml2 and libxslt development packages are installed

在安装Python包时遇到Pleasemakesurethelibxml2andlibxsltdevelopmentpackagesareinstalled错误,可以通过在Linux系统中使用`sudoapt-getinstalllibxml2-dev`和`sudoapt-getinstalllibxslt-dev`命令来安装缺失的开发包,之后重试安装即可。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决Pip install 安装Python包时出现的 Please make sure the libxml2 and libxslt development packages are installed问题

sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev

重新安装所需的包即可

134.4 Collecting lxml==4.6.2 (from scrapy_plus->-r /app/requirements.txt (line 1)) 134.7 Downloading https://mirrors.aliyun.com/pypi/packages/db/f7/43fecb94d66959c1e23aa53d6161231dca0e93ec500224cf31b3c4073e37/lxml-4.6.2.tar.gz (3.2 MB) 137.1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 1.3 MB/s eta 0:00:00 139.3 Preparing metadata (setup.py): started 140.2 Preparing metadata (setup.py): finished with status 'error' 140.2 error: subprocess-exited-with-error 140.2 140.2 × python setup.py egg_info did not run successfully. 140.2 │ exit code: 1 140.2 ╰─> [5 lines of output] 140.2 /tmp/pip-install-kpag10_k/lxml_29d6aecc79634d7eb73c254343ea111a/setup.py:64: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html 140.2 import pkg_resources 140.2 Building lxml version 4.6.2. 140.2 Building without Cython. 140.2 Error: Please make sure the libxml2 and libxslt development packages are installed. 140.2 [end of output] 140.2 140.2 note: This error originates from a subprocess, and is likely not a problem with pip. 140.2 error: metadata-generation-failed 140.2 140.2 × Encountered error while generating package metadata. 140.2 ╰─> See above for output. 140.2 140.2 note: This is an issue with the package mentioned above, not pip. 140.2 hint: See above for details. 140.9 140.9 [notice] A new release of pip is available: 24.0 -> 25.0.1 140.9 [notice] To update, run: python3.10 -m pip install --upgrade pip ------ failed to solve: process "/bin/sh -c pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r /app/requirements.txt" did not complete successfully: exit code: 1
最新发布
04-03
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值