impossible to install lxml package for python 3.9 on centos7.9

37 Views Asked by At

I want to install lxml 5.1.0 package on my Python 3.9 installation on Centos7.9

I tried both installing from a .targz and a .whl file.

Using .whl file, I have the following error message:

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.

Using .tar.gz file, I needed to install Cython first but then I have still the following error message:

[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]

But Cython 3.0.9 is well installed:

[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

Why does the installer not accept this dependency? How can I successfully install lxml on this platform?

1

There are 1 best solutions below

0
iostrym On

the problem is that I don't have access to internet and it seems that pip need internet access to make installation from source (no problem when installation from .whl package).

so I need to add "--no-build-isolation" to the pip install command. magic ...