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'
× 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
Building without Cython.
Using build configuration of libxslt 1.1.34
building 'lxml.etree' extension
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"
Compile failed: command '/usr/bin/gcc' failed with exit code 1
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.
gdc_client source code has been cloned to
Cython < 3 to
setup.py and then running
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"
lxml 4.4.2from https://github.com/lxml/lxml/releases/tag/lxml-4.4.2
tar xf lxml-4.4.2.tar.gz
python setup.py bdist_wheel
pip install ./lxml-4.4.2-cp311-cp311-linux_x86_64.whl
pip install -r requirements.txt
python setup.py install
This creates the
gdc_client executable script in