使用下面命令下载离线包提示错误:
pip download --no-binary=:all: -d package -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
错误信息
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
/tmp/pip-download-5exctlls/lxml_daf61a35d67a45968aee69c26eb7918f/setup.py:67: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Building lxml version 5.0.1.
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: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
参考https://lequ7.com/guan-yu-pythonpython-xiang-mu-shi-pei-arm-jia-gou-guo-chan-qi-lin-xi-tong.html
解决办法:
sudo apt install -d libxml2 libxslt1-dev
再次执行成功下载。