0

I'm running into some trouble installing lxml on Linux Mint 20.1 Python 3.8.10

The error message I'm getting is a bunch of these 'too many arguments to function' -

src/lxml/etree.c:411:11: error: too many arguments to function ‘PyCode_New’
      411 |           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
          |           ^~~~~~~~~~
    src/lxml/etree.c:231250:35: note: in expansion of macro ‘__Pyx_PyCode_New’
    231250 |   __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_validate, 3522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) __PYX_ERR(0, 3522, __pyx_L1_error)
           |                                   ^~~~~~~~~~~~~~~~
    In file included from /usr/include/python3.8/compile.h:5,
                     from /usr/include/python3.8/Python.h:138,
                     from src/lxml/etree.c:97:
    /usr/include/python3.8/code.h:122:28: note: declared here
      122 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
          |                            ^~~~~~~~~~
    src/lxml/etree.c:411:11: error: too many arguments to function ‘PyCode_New’
      411 |           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
          |           ^~~~~~~~~~
    src/lxml/etree.c:231262:35: note: in expansion of macro ‘__Pyx_PyCode_New’
    231262 |   __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_assertValid, 3531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) __PYX_ERR(0, 3531, __pyx_L1_error)
           |                                   ^~~~~~~~~~~~~~~~
    In file included from /usr/include/python3.8/compile.h:5,
                     from /usr/include/python3.8/Python.h:138,
                     from src/lxml/etree.c:97:
    /usr/include/python3.8/code.h:122:28: note: declared here
      122 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
          |                            ^~~~~~~~~~
    src/lxml/etree.c:411:11: error: too many arguments to function ‘PyCode_New’
      411 |           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)

$ easy_install lxml==4.3.4
Searching for lxml==4.3.4
Reading https://pypi.org/simple/lxml/
Downloading https://files.pythonhosted.org/packages/da/b5/d3e0d22649c63e92cb0902847da9ae155c1e801178ab5d272308f35f726e/lxml-4.3.4.tar.gz#sha256=3ce1c49d4b4a7bc75fb12acb3a6247bb7a91fe420542e6d671ba9187d12a12c2
Best match: lxml 4.3.4
Processing lxml-4.3.4.tar.gz
Writing /tmp/easy_install-_q0s5bd7/lxml-4.3.4/setup.cfg
Running lxml-4.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_q0s5bd7/lxml-4.3.4/egg-dist-tmp-vf7jwisa
Building lxml version 4.3.4.
Building without Cython.
Using build configuration of libxslt 1.1.34
Compile failed: command 'gcc' failed with exit status 1

I followed the advice here libxml install error using pip

and have all the packages installed

enter image description here

enter image description here

enter image description here

Is there anything else I'm missing in order to get this to install?

Thanks!

  • I got the same error doing `pip install lxml==4.3.4` in a Python3.8 virtualenv, but could install successfully with `pip install lxml`. – snakecharmerb Sep 25 '21 at 17:46
  • Probably should have mentioned it, I am also able to install newer versions of lxml but I am not in control of the version of lxml used in this project, at least I don't think...I can't find any place where I could update the version it has pinned grep -r "lxml==4.3.4" project/failure.txt:Searching for lxml==4.3.4 ^^ is the only search result for lxml w/ that version – Jeremy Farmer Sep 25 '21 at 20:28
  • Checking the versions here, may it relates to cython version? https://lxml.de/4.6/changes-4.6.3.html – snakecharmerb Sep 25 '21 at 20:31

0 Answers0