Score:0

ERROR: Failed building wheel for lxml

tm flag

Please I'm not a computer guy or anything am just trying to install a script by typing :

pip install -r requirements.txt 

and then this error shows up twice during the process and I have no idea why :

First :

      Compile failed: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      creating tmp
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitd5e8a29v.c -o tmp/xmlXPathInitd5e8a29v.o
      cc tmp/xmlXPathInitd5e8a29v.o -lxml2 -o a.out
      error: command '/usr/bin/x86_64-linux-gnu-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
Installing collected packages: lxml, chardet, alabaster, urllib3, sphinxcontrib-serializinghtml, Pygments, pockets, imagesize, idna, docutils, beautifulsoup4, sphinxcontrib-websupport, sphinxcontrib-napoleon, requests, sphinx, nyawc
  Attempting uninstall: lxml
    Found existing installation: lxml 4.9.1
    Not uninstalling lxml at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'lxml'. No files were found to uninstall.
  Running setup.py install for lxml ... error
  error: subprocess-exited-with-error

  × Running setup.py install for lxml did not run successfully.
  │ exit code: 1

and this one at the end :

 Compile failed: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitu8wuxket.c -o tmp/xmlXPathInitu8wuxket.o
      cc tmp/xmlXPathInitu8wuxket.o -lxml2 -o a.out
      error: command '/usr/bin/x86_64-linux-gnu-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: Can't roll back lxml; was not uninstalled
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lxml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I assume it's something about the compiler gcc or something because I have lxml installed.

I'll appreciate the help and thank you so much in advance.

waltinator avatar
it flag
Do this one time: `sudo apt install build-essential`. That pseudo package will install all you need, probably. Please read https://askubuntu.com/help/how-to-ask and https://askubuntu.com/help/formatting
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.