如何修复“Building wheel for lxml”问题?

huangapple go评论175阅读模式
英文:

How to fix problem with Building wheel for lxml?

问题

我正在尝试从requiremnents.txt文件中安装一些依赖项,但我收到下面显示的错误。

我正在使用MacOS 13.3,在一台M2芯片的MacBook Pro上运行Python 3.11.3,使用了一个虚拟环境(venv)。

然而,如果我尝试在Python脚本中导入lxml,它可以正常工作。而且,当我尝试pip install lxml时,它说它已经安装了。

我已经尝试了很多在网上找到的可能的修复方法,但我没有成功解决这个问题。

是否有人成功解决了这个问题?或者有什么想法可以尝试?

请注意,这个错误来源于一个子进程,可能不是pip的问题。

英文:

I'm trying to install some dependencies from a requiremnents.txt file and I'm getting the error shown below.
I'm using a MacOS 13.3, on a M2 chip MacBook Pro. Running Python 3.11.3 on a venv

However, if I try to import lxml on a Python script, it works just fine. Also when I try pip install lxml, it says it is already installed.
I've already tried a bunch of possible fixes I found online, but I didn't manage to get that fixed.

Did anyone manage to fix this issue? Or have any ideas to try out?

Building wheels for collected packages: lxml
  Building wheel for lxml (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [145 lines of output]
      Building lxml version 4.6.5.
      Building without Cython.
      Building against libxml2 2.9.13 and libxslt 1.1.35
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-13-arm64-cpython-311
      creating build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/_elementpath.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/sax.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/pyclasslookup.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/doctestcompare.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/cssselect.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/ElementInclude.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      creating build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      creating build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/soupparser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/defs.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_setmixin.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/clean.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_diffcommand.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/html5parser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/formfill.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/ElementSoup.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_html5builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/diff.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
      copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
      copying src/lxml/etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/lxml.etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/lxml.etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/c14n.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/__init__.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/schematron.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/tree.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/uri.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xpath.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xslt.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/config.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/lxml-version.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/etree_defs.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
      copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      running build_ext
      building 'lxml.etree' extension
      creating build/temp.macosx-13-arm64-cpython-311
      creating build/temp.macosx-13-arm64-cpython-311/src
      creating build/temp.macosx-13-arm64-cpython-311/src/lxml
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/opt/homebrew/opt/postgresql@15/include -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/Users/cauenapier/Documents/GitHub/vali/backend/myenv/include -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/lxml/etree.c -o build/temp.macosx-13-arm64-cpython-311/src/lxml/etree.o -w -flat_namespace
      src/lxml/etree.c:261877:23: error: no member named 'exc_type' in 'struct _err_stackitem'
          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
                  ~~~~~~~~  ^
      src/lxml/etree.c:261877:53: error: no member named 'exc_type' in 'struct _err_stackitem'
          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
                                                ~~~~~~~~  ^
      src/lxml/etree.c:261891:23: error: no member named 'exc_type' in 'struct _err_stackitem'
          *type = exc_info->exc_type;
                  ~~~~~~~~  ^
      src/lxml/etree.c:261893:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          *tb = exc_info->exc_traceback;
                ~~~~~~~~  ^
      src/lxml/etree.c:261907:26: error: no member named 'exc_type' in 'struct _err_stackitem'
          tmp_type = exc_info->exc_type;
                     ~~~~~~~~  ^
      src/lxml/etree.c:261909:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tmp_tb = exc_info->exc_traceback;
                   ~~~~~~~~  ^
      src/lxml/etree.c:261910:15: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_info->exc_type = type;
          ~~~~~~~~  ^
      src/lxml/etree.c:261912:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          exc_info->exc_traceback = tb;
          ~~~~~~~~  ^
      src/lxml/etree.c:261994:30: error: no member named 'exc_type' in 'struct _err_stackitem'
              tmp_type = exc_info->exc_type;
                         ~~~~~~~~  ^
      src/lxml/etree.c:261996:28: error: no member named 'exc_traceback' in 'struct _err_stackitem'
              tmp_tb = exc_info->exc_traceback;
                       ~~~~~~~~  ^
      src/lxml/etree.c:261997:19: error: no member named 'exc_type' in 'struct _err_stackitem'
              exc_info->exc_type = local_type;
              ~~~~~~~~  ^
      src/lxml/etree.c:261999:19: error: no member named 'exc_traceback' in 'struct _err_stackitem'
              exc_info->exc_traceback = local_tb;
              ~~~~~~~~  ^
      src/lxml/etree.c:262185:26: error: no member named 'exc_type' in 'struct _err_stackitem'
          tmp_type = exc_info->exc_type;
                     ~~~~~~~~  ^
      src/lxml/etree.c:262187:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tmp_tb = exc_info->exc_traceback;
                   ~~~~~~~~  ^
      src/lxml/etree.c:262188:15: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_info->exc_type = *type;
          ~~~~~~~~  ^
      src/lxml/etree.c:262190:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          exc_info->exc_traceback = *tb;
          ~~~~~~~~  ^
      src/lxml/etree.c:264391:20: error: no member named 'exc_type' in 'struct _err_stackitem'
          t = exc_state->exc_type;
              ~~~~~~~~~  ^
      src/lxml/etree.c:264393:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tb = exc_state->exc_traceback;
               ~~~~~~~~~  ^
      src/lxml/etree.c:264394:16: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_state->exc_type = NULL;
          ~~~~~~~~~  ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      Compile failed: command '/usr/bin/clang' failed with exit code 1
      creating var
      creating var/folders
      creating var/folders/6c
      creating var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn
      creating var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T
      cc -I/usr/include/libxml2 -c /var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.c -o var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.o
      cc var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.o -lxml2 -o a.out
      error: command '/usr/bin/clang' 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: sentry-sdk, pbr, oauthlib, lxml, jmespath, isodate, imgkit, hyperlink, hyperframe, hpack, hiredis, h11, gunicorn, future, et-xmlfile, entrypoints, docutils, django-timezone-field, django-simple-history, django-ipware, django-constance, Django, click-plugins, click-didyoumean, beautifulsoup4, Automat, async-timeout, apache-age-python, amqp, xmlsec, wsproto, uvicorn, uncertainties, twisted, redis, rdflib, python-crontab, openpyxl, mailchimp3, m2r2, kombu, h2, djangorestframework, django-storages, django-slack, django-rest-hooks, django-polymorphic, django-picklefield, django-oauth-toolkit, django-jsonfield, django-js-asset, django-inline-actions, django-health-check, django-filter, django-currentuser, django-cors-headers, django-axes, django-annoying, coreschema, click-repl, botocore, aioredis, sorl-thumbnail-serializer-field, service-identity, s3transfer, python3-saml, pyopenssl, pyexcel-xlsx, ipython, hypercorn, djangorestframework-filters, djangorestframework-csv, django-rest-auth, django-redis, django-mptt, coreapi, celery, autobahn, nbconvert, drf-yasg, django-celery-beat, boto3, daphne, channels, channels_redis
  Attempting uninstall: pbr
    Found existing installation: pbr 1.6.0
    Uninstalling pbr-1.6.0:
      Successfully uninstalled pbr-1.6.0
  Attempting uninstall: oauthlib
    Found existing installation: oauthlib 3.2.2
    Uninstalling oauthlib-3.2.2:
      Successfully uninstalled oauthlib-3.2.2
  Attempting uninstall: lxml
    Found existing installation: lxml 4.9.2
    Uninstalling lxml-4.9.2:
      Successfully uninstalled lxml-4.9.2
  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
  ╰─> [142 lines of output]
      Building lxml version 4.6.5.
      Building without Cython.
      Building against libxml2 2.9.13 and libxslt 1.1.35
      running install
      /Users/cauenapier/Documents/GitHub/vali/backend/myenv/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.macosx-13-arm64-cpython-311
      creating build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/_elementpath.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/sax.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/pyclasslookup.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/doctestcompare.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/cssselect.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/ElementInclude.py -> build/lib.macosx-13-arm64-cpython-311/lxml
      creating build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      creating build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/soupparser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/defs.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_setmixin.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/clean.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_diffcommand.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/html5parser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/formfill.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/ElementSoup.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/_html5builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      copying src/lxml/html/diff.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
      copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
      copying src/lxml/etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/lxml.etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/lxml.etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
      copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/c14n.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/__init__.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/schematron.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/tree.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/uri.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xpath.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xslt.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/config.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/lxml-version.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      copying src/lxml/includes/etree_defs.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
      copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
      creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      running build_ext
      building 'lxml.etree' extension
      creating build/temp.macosx-13-arm64-cpython-311
      creating build/temp.macosx-13-arm64-cpython-311/src
      creating build/temp.macosx-13-arm64-cpython-311/src/lxml
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/opt/homebrew/opt/postgresql@15/include -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/Users/cauenapier/Documents/GitHub/vali/backend/myenv/include -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/lxml/etree.c -o build/temp.macosx-13-arm64-cpython-311/src/lxml/etree.o -w -flat_namespace
      src/lxml/etree.c:261877:23: error: no member named 'exc_type' in 'struct _err_stackitem'
          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
                  ~~~~~~~~  ^
      src/lxml/etree.c:261877:53: error: no member named 'exc_type' in 'struct _err_stackitem'
          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
                                                ~~~~~~~~  ^
      src/lxml/etree.c:261891:23: error: no member named 'exc_type' in 'struct _err_stackitem'
          *type = exc_info->exc_type;
                  ~~~~~~~~  ^
      src/lxml/etree.c:261893:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          *tb = exc_info->exc_traceback;
                ~~~~~~~~  ^
      src/lxml/etree.c:261907:26: error: no member named 'exc_type' in 'struct _err_stackitem'
          tmp_type = exc_info->exc_type;
                     ~~~~~~~~  ^
      src/lxml/etree.c:261909:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tmp_tb = exc_info->exc_traceback;
                   ~~~~~~~~  ^
      src/lxml/etree.c:261910:15: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_info->exc_type = type;
          ~~~~~~~~  ^
      src/lxml/etree.c:261912:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          exc_info->exc_traceback = tb;
          ~~~~~~~~  ^
      src/lxml/etree.c:261994:30: error: no member named 'exc_type' in 'struct _err_stackitem'
              tmp_type = exc_info->exc_type;
                         ~~~~~~~~  ^
      src/lxml/etree.c:261996:28: error: no member named 'exc_traceback' in 'struct _err_stackitem'
              tmp_tb = exc_info->exc_traceback;
                       ~~~~~~~~  ^
      src/lxml/etree.c:261997:19: error: no member named 'exc_type' in 'struct _err_stackitem'
              exc_info->exc_type = local_type;
              ~~~~~~~~  ^
      src/lxml/etree.c:261999:19: error: no member named 'exc_traceback' in 'struct _err_stackitem'
              exc_info->exc_traceback = local_tb;
              ~~~~~~~~  ^
      src/lxml/etree.c:262185:26: error: no member named 'exc_type' in 'struct _err_stackitem'
          tmp_type = exc_info->exc_type;
                     ~~~~~~~~  ^
      src/lxml/etree.c:262187:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tmp_tb = exc_info->exc_traceback;
                   ~~~~~~~~  ^
      src/lxml/etree.c:262188:15: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_info->exc_type = *type;
          ~~~~~~~~  ^
      src/lxml/etree.c:262190:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          exc_info->exc_traceback = *tb;
          ~~~~~~~~  ^
      src/lxml/etree.c:264391:20: error: no member named 'exc_type' in 'struct _err_stackitem'
          t = exc_state->exc_type;
              ~~~~~~~~~  ^
      src/lxml/etree.c:264393:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
          tb = exc_state->exc_traceback;
               ~~~~~~~~~  ^
      src/lxml/etree.c:264394:16: error: no member named 'exc_type' in 'struct _err_stackitem'
          exc_state->exc_type = NULL;
          ~~~~~~~~~  ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      Compile failed: command '/usr/bin/clang' failed with exit code 1
      cc -I/usr/include/libxml2 -c /var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.c -o var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.o
      cc var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.o -lxml2 -o a.out
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of lxml
  Moving to /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/lxml-4.9.2.dist-info/
   from /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/~xml-4.9.2.dist-info
  Moving to /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/lxml/
   from /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/~xml
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.

答案1

得分: 1

你可以更新已安装的Xcode命令行工具的版本,而不是升级MacOS。您可以通过在终端中运行以下命令来执行此操作:

xcode-select --install

然后安装lxml:

pip install lxml

如果您之前使用Homebrew安装了"lxml",您可能需要首先尝试卸载它。
我没有这样做,但只是为了让您知道如何操作:

brew uninstall --ignore-dependencies lxml
英文:

You can update the version of the Xcode Command Line Tools installed, instead of update the MacOS. You can do it by running the following command in your terminal:

xcode-select --install

And then instal lxml:

pip install lxml

If you have previously installed "lxml" using Homebrew, you might want to try uninstalling it first.
I didn't and it still worked, but just to let you know how to do it:

brew uninstall --ignore-dependencies lxml

答案2

得分: 0

今天我已经升级了MacOS,问题就这样消失了!

英文:

Today I have updated MacOS and the problem simply disappeared!

huangapple
  • 本文由 发表于 2023年4月10日 22:10:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75977846.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定