Notes on building https://github.com/NCI-GDC/gdc-client
Following their instructions, get error in building lxml
Python package:
Building wheels for collected packages: lxml
Building wheel for lxml (setup.py): started
Building wheel for lxml (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [97 lines of output]
Building lxml version 4.4.2.
/tmp/pip-install-f3lu9_f_/lxml_2b73c7f2ec5345da925d4c9a21d250a8/setup.py:64: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.i
o/en/latest/pkg_resources.html
import pkg_resources
Building without Cython.
Using build configuration of libxslt 1.1.34
running bdist_wheel
running build
running build_py
...
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/src
creating build/temp.linux-x86_64-cpython-311/src/lxml
gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/home/chind/Src/gdc-client/venv/include -I/home/chind/opt/include/python3.11 -c src/lxml/etree.c -o build/temp.linux-x86_64-cpython-311/src/lxml/etree.o -w
src/lxml/etree.c:289:12: fatal error: longintrepr.h: No such file or directory
289 | #include "longintrepr.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
Compile failed: command '/usr/bin/gcc' failed with exit code 1
creating tmp
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitymh_uec5.c -o tmp/xmlXPathInitymh_uec5.o
cc tmp/xmlXPathInitymh_uec5.o -lxml2 -o a.out
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects
The key bit is Building without Cython. We can fix the error by using Cython instead of avoiding it.
Assume gdc_client
source code has been cloned to SOMEWHERE/gdc_client
Manually adding Cython < 3
to setup.py
and then running pip-compile
to
generate a new requirements.txt
did not work: the same error occurs.
I found that manually installing Cython < 3
with pip, and installing lxml == 4.4.2
manually from source worked.
Do everything below while in the venv as per gdc_client
build instructions.
pip install "Cython<3"
- Download
lxml 4.4.2
from https://github.com/lxml/lxml/releases/tag/lxml-4.4.2tar xf lxml-4.4.2.tar.gz
cd lxml-4.4.2
python setup.py bdist_wheel
cd dist
pip install ./lxml-4.4.2-cp311-cp311-linux_x86_64.whl
cd SOMEWHERE/gdc_client
pip install -r requirements.txt
python setup.py install
This creates the gdc_client
executable script in SOMEWHRE/gdc_client/bin
There is no way we can help without knowing what website you are referring to and what the error is.
The point of this comment was to encourage OP to provide a minimum of details so we are not reduced to doing web searches for people. Obviously we can all do that, but the idea is to help with the issue and knowing what that is will save everyone a lot of time. It will also focus the answers and promote higher quality discussions.