Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxml Importing error #9

Open
see7e opened this issue Mar 25, 2024 · 0 comments
Open

lxml Importing error #9

see7e opened this issue Mar 25, 2024 · 0 comments

Comments

@see7e
Copy link

see7e commented Mar 25, 2024

Hello all, I'm getting an installation of lxml package:

Installing collected packages: wget, progress, MarkupSafe, lxml, itsdangerous, click, Werkzeug, Jinja2, Flask
Running setup.py install for wget ... done
Running setup.py install for progress ... done
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
╰─> [97 lines of output]
    Building lxml version 4.5.0.
    Building without Cython. 
    ERROR: b'/bin/sh: 1: xslt-config: not found\n'
    ** make sure the development packages of libxml2 and libxslt are installed **
    Using build configuration of libxslt
    running install
    /home/see7e/byon_scripts/qgs-plugin-repo/qgis-plugins-xml/venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
        running build
        running build_py
        creating build
        creating build/lib.linux-x86_64-3.11
        creating build/lib.linux-x86_64-3.11/lxml
        copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-3.11/lxml
        copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.11/lxml
        copying src/lxml/__init__.py -> build/lib.linux-x86_64-3.11/lxml      
        copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.11/lxml     
        copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-3.11/lxml 
        copying src/lxml/builder.py -> build/lib.linux-x86_64-3.11/lxml       
        copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-3.11/lxml    
        copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.11/lxml  
        copying src/lxml/sax.py -> build/lib.linux-x86_64-3.11/lxml           
        creating build/lib.linux-x86_64-3.11/lxml/includes                    
        copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-3.11/lxml/includes
        creating build/lib.linux-x86_64-3.11/lxml/html                        
        copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-3.11/lxml/html      
        copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-3.11/lxml/html   
        copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-3.11/lxml/html        
        copying src/lxml/html/diff.py -> build/lib.linux-x86_64-3.11/lxml/html
        copying src/lxml/html/defs.py -> build/lib.linux-x86_64-3.11/lxml/html
        copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-3.11/lxml/html     
        copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-3.11/lxml/html        
        copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-3.11/lxml/html    
        copying src/lxml/html/builder.py -> build/lib.linux-x86_64-3.11/lxml/html         
        copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-3.11/lxml/html       
        copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-3.11/lxml/html      
        copying src/lxml/html/clean.py -> build/lib.linux-x86_64-3.11/lxml/html           
        copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-3.11/lxml/html     
        creating build/lib.linux-x86_64-3.11/lxml/isoschematron 
        copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-3.11/lxml/isoschematron
        copying src/lxml/etree.h -> build/lib.linux-x86_64-3.11/lxml
        copying src/lxml/etree_api.h -> build/lib.linux-x86_64-3.11/lxml
        copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-3.11/lxml     
        copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-3.11/lxml 
        copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-3.11/lxml/includes  
        copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-3.11/lxml/includes
        copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-3.11/lxml/includes
        copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-3.11/lxml/includes 
        copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-3.11/lxml/includes       
        copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-3.11/lxml/includes 
        copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-3.11/lxml/includes   
        copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-3.11/lxml/includes  
        copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-3.11/lxml/includes
        copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-3.11/lxml/includes  
        copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-3.11/lxml/includes 
        copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-3.11/lxml/includes    
        copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-3.11/lxml/includes
        copying src/lxml/includes/__init__.pxd -> build/lib.linux-x86_64-3.11/lxml/includes  
        copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-3.11/lxml/includes
        copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-3.11/lxml/includes  
        creating build/lib.linux-x86_64-3.11/lxml/isoschematron/resources     
        creating build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/rng 
        copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/rng
        creating build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl 
        copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl
        copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl
        creating build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1                                         
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1                                           
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1                                     
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1                                        
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
        copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.11/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
        running build_ext
        building 'lxml.etree' extension
        creating build/temp.linux-x86_64-3.11
        creating build/temp.linux-x86_64-3.11/src
        creating build/temp.linux-x86_64-3.11/src/lxml
        x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/home/see7e/byon_scripts/qgs-plugin-repo/qgis-plugins-xml/venv/include -I/usr/include/python3.11 -c src/lxml/etree.c -o build/temp.linux-x86_64-3.11/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/x86_64-linux-gnu-gcc' failed with exit code 1
        creating tmp
        cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitd3m7_ccy.c -o tmp/xmlXPathInitd3m7_ccy.o
        /tmp/xmlXPathInitd3m7_ccy.c:1:10: fatal error: libxml/xpath.h: No such file or directory
            1 | #include "libxml/xpath.h"
                |          ^~~~~~~~~~~~~~~~
        compilation terminated.
        *********************************************************************************
        Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
        *********************************************************************************
        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: legacy-install-failure

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

Tried installing separately:

  • Cython:

    pip install Cython
  • Reinstalling lxml:

    pip install --upgrade --force-reinstall lxml==4.5.0
  • Or even installing manualy the dependencies manualy:

    sudo apt-get install libxml2-dev libxslt-dev
    pip install --upgrade --force-reinstall lxml==4.5.0

But the error still persists... here is the env settings

OS: Ubuntu 22.04.4 LTS on Windows 10 x86_64
Kernel: 5.15.133.1-microsoft-standard-WSL2
Shell: bash 5.1.16
Terminal: Windows Terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant