How to install lxml<4.0 with python3.7 on Amazon Linux 2












0














I'm trying to install lxml<4.0 on an Amazon Linux 2 image with python 3.7



sudo pip3 install "lxml<4.0"



At first it tries to build the wheel:



... truncated output ...

src/lxml/lxml.etree.c: In function ‘__Pyx_PyList_Pop’:
src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyList_Type_pop.func’
(PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:234476:12: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
^
src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
(PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
^
Compile failed: command 'gcc' failed with exit status 1
creating tmp
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitnqtfzdpm.c -o tmp/xmlXPathInitnqtfzdpm.o
/tmp/xmlXPathInitnqtfzdpm.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
cc tmp/xmlXPathInitnqtfzdpm.o -L/usr/lib64 -lxml2 -o a.out
error: command 'gcc' failed with exit status 1

----------------------------------------
Failed building wheel for lxml


And then tries with setup.py:



... truncated output ...

src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
(PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
^
Compile failed: command 'gcc' failed with exit status 1
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit72g06utf.c -o tmp/xmlXPathInit72g06utf.o
/tmp/xmlXPathInit72g06utf.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
cc tmp/xmlXPathInit72g06utf.o -L/usr/lib64 -lxml2 -o a.out
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1qjhur44/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jqitj_hs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1qjhur44/lxml/


It does't seem to be a missing library problem, but an incompatibility issue. How can I fix this?










share|improve this question





























    0














    I'm trying to install lxml<4.0 on an Amazon Linux 2 image with python 3.7



    sudo pip3 install "lxml<4.0"



    At first it tries to build the wheel:



    ... truncated output ...

    src/lxml/lxml.etree.c: In function ‘__Pyx_PyList_Pop’:
    src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyList_Type_pop.func’
    (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/lxml/lxml.etree.c:234476:12: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
    ^
    src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
    src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
    (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
    ^
    Compile failed: command 'gcc' failed with exit status 1
    creating tmp
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitnqtfzdpm.c -o tmp/xmlXPathInitnqtfzdpm.o
    /tmp/xmlXPathInitnqtfzdpm.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    main (int argc, char **argv) {
    ^~~~
    cc tmp/xmlXPathInitnqtfzdpm.o -L/usr/lib64 -lxml2 -o a.out
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
    Failed building wheel for lxml


    And then tries with setup.py:



    ... truncated output ...

    src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
    src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
    (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
    ^
    Compile failed: command 'gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit72g06utf.c -o tmp/xmlXPathInit72g06utf.o
    /tmp/xmlXPathInit72g06utf.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    main (int argc, char **argv) {
    ^~~~
    cc tmp/xmlXPathInit72g06utf.o -L/usr/lib64 -lxml2 -o a.out
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1qjhur44/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jqitj_hs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1qjhur44/lxml/


    It does't seem to be a missing library problem, but an incompatibility issue. How can I fix this?










    share|improve this question



























      0












      0








      0







      I'm trying to install lxml<4.0 on an Amazon Linux 2 image with python 3.7



      sudo pip3 install "lxml<4.0"



      At first it tries to build the wheel:



      ... truncated output ...

      src/lxml/lxml.etree.c: In function ‘__Pyx_PyList_Pop’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyList_Type_pop.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:234476:12: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
      ^
      src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
      ^
      Compile failed: command 'gcc' failed with exit status 1
      creating tmp
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitnqtfzdpm.c -o tmp/xmlXPathInitnqtfzdpm.o
      /tmp/xmlXPathInitnqtfzdpm.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
      main (int argc, char **argv) {
      ^~~~
      cc tmp/xmlXPathInitnqtfzdpm.o -L/usr/lib64 -lxml2 -o a.out
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Failed building wheel for lxml


      And then tries with setup.py:



      ... truncated output ...

      src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
      ^
      Compile failed: command 'gcc' failed with exit status 1
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit72g06utf.c -o tmp/xmlXPathInit72g06utf.o
      /tmp/xmlXPathInit72g06utf.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
      main (int argc, char **argv) {
      ^~~~
      cc tmp/xmlXPathInit72g06utf.o -L/usr/lib64 -lxml2 -o a.out
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1qjhur44/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jqitj_hs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1qjhur44/lxml/


      It does't seem to be a missing library problem, but an incompatibility issue. How can I fix this?










      share|improve this question















      I'm trying to install lxml<4.0 on an Amazon Linux 2 image with python 3.7



      sudo pip3 install "lxml<4.0"



      At first it tries to build the wheel:



      ... truncated output ...

      src/lxml/lxml.etree.c: In function ‘__Pyx_PyList_Pop’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyList_Type_pop.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:234476:12: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
      ^
      src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
      ^
      Compile failed: command 'gcc' failed with exit status 1
      creating tmp
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitnqtfzdpm.c -o tmp/xmlXPathInitnqtfzdpm.o
      /tmp/xmlXPathInitnqtfzdpm.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
      main (int argc, char **argv) {
      ^~~~
      cc tmp/xmlXPathInitnqtfzdpm.o -L/usr/lib64 -lxml2 -o a.out
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Failed building wheel for lxml


      And then tries with setup.py:



      ... truncated output ...

      src/lxml/lxml.etree.c: In function ‘__Pyx_PyDict_Values’:
      src/lxml/lxml.etree.c:4532:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_values.func’
      (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :
      ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/lxml/lxml.etree.c:235119:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
      return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
      ^
      Compile failed: command 'gcc' failed with exit status 1
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit72g06utf.c -o tmp/xmlXPathInit72g06utf.o
      /tmp/xmlXPathInit72g06utf.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
      main (int argc, char **argv) {
      ^~~~
      cc tmp/xmlXPathInit72g06utf.o -L/usr/lib64 -lxml2 -o a.out
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1qjhur44/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-jqitj_hs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1qjhur44/lxml/


      It does't seem to be a missing library problem, but an incompatibility issue. How can I fix this?







      lxml amazon-linux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 23:02

























      asked Nov 20 at 22:47









      villasv

      2,14011537




      2,14011537





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402747%2fhow-to-install-lxml4-0-with-python3-7-on-amazon-linux-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402747%2fhow-to-install-lxml4-0-with-python3-7-on-amazon-linux-2%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'