我想在 Centos7.9 上的 Python 3.9 安装上安装 lxml 5.1.0 包
我尝试从
.targz
和 .whl
文件安装。
使用
.whl
文件,我收到以下错误消息:
ERROR: lxml-5.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is not a supported wheel on this platform.
使用
.tar.gz
文件,我需要先安装 Cython 但仍然出现以下错误消息:
[centos@centos7 package_python39]$ sudo /usr/local/bin/python3.9 -m pip install lxml-5.1.0.tar.gz
Processing ./lxml-5.1.0.tar.gz
Installing build dependencies ... error
error: subprocess-exited-with-error
[...]
ERROR: Could not find a version that satisfies the requirement Cython>=3.0.7 (from versions: none)
ERROR: No matching distribution found for Cython>=3.0.7
[end of output]
但是Cython 3.0.9安装得很好:
[centos@centos7 package_python39]$ sudo /usr/local/bin/pip3.9 list
Package Version
---------- -------
Cython 3.0.9
et-xmlfile 1.1.0
htmldom 2.0
openpyxl 3.1.2
pip 23.0.1
setuptools 58.1.0
xlrd3 1.1.0
为什么安装程序不接受此依赖项?我怎样才能在这个平台上成功安装
lxml
?
问题是我无法访问互联网,并且 pip 似乎需要互联网访问才能从源代码进行安装(从 .whl 包安装时没有问题)。
所以我需要在 pip install 命令中添加“--no-build-isolation”。魔法...