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

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

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?

  1. Building wheels for collected packages: lxml
  2. Building wheel for lxml (setup.py) ... error
  3. error: subprocess-exited-with-error
  4. × python setup.py bdist_wheel did not run successfully.
  5. exit code: 1
  6. ╰─> [145 lines of output]
  7. Building lxml version 4.6.5.
  8. Building without Cython.
  9. Building against libxml2 2.9.13 and libxslt 1.1.35
  10. running bdist_wheel
  11. running build
  12. running build_py
  13. creating build
  14. creating build/lib.macosx-13-arm64-cpython-311
  15. creating build/lib.macosx-13-arm64-cpython-311/lxml
  16. copying src/lxml/_elementpath.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  17. copying src/lxml/sax.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  18. copying src/lxml/pyclasslookup.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  19. copying src/lxml/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  20. copying src/lxml/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  21. copying src/lxml/doctestcompare.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  22. copying src/lxml/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  23. copying src/lxml/cssselect.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  24. copying src/lxml/ElementInclude.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  25. creating build/lib.macosx-13-arm64-cpython-311/lxml/includes
  26. copying src/lxml/includes/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  27. creating build/lib.macosx-13-arm64-cpython-311/lxml/html
  28. copying src/lxml/html/soupparser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  29. copying src/lxml/html/defs.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  30. copying src/lxml/html/_setmixin.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  31. copying src/lxml/html/clean.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  32. copying src/lxml/html/_diffcommand.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  33. copying src/lxml/html/html5parser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  34. copying src/lxml/html/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  35. copying src/lxml/html/formfill.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  36. copying src/lxml/html/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  37. copying src/lxml/html/ElementSoup.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  38. copying src/lxml/html/_html5builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  39. copying src/lxml/html/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  40. copying src/lxml/html/diff.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  41. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
  42. copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
  43. copying src/lxml/etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  44. copying src/lxml/etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  45. copying src/lxml/lxml.etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  46. copying src/lxml/lxml.etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  47. copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  48. copying src/lxml/includes/c14n.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  49. copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  50. copying src/lxml/includes/__init__.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  51. copying src/lxml/includes/schematron.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  52. copying src/lxml/includes/tree.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  53. copying src/lxml/includes/uri.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  54. copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  55. copying src/lxml/includes/xpath.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  56. copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  57. copying src/lxml/includes/xslt.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  58. copying src/lxml/includes/config.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  59. copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  60. copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  61. copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  62. copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  63. copying src/lxml/includes/lxml-version.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  64. copying src/lxml/includes/etree_defs.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  65. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources
  66. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
  67. copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
  68. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  69. copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  70. copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  71. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. running build_ext
  79. building 'lxml.etree' extension
  80. creating build/temp.macosx-13-arm64-cpython-311
  81. creating build/temp.macosx-13-arm64-cpython-311/src
  82. creating build/temp.macosx-13-arm64-cpython-311/src/lxml
  83. 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
  84. src/lxml/etree.c:261877:23: error: no member named 'exc_type' in 'struct _err_stackitem'
  85. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  86. ~~~~~~~~ ^
  87. src/lxml/etree.c:261877:53: error: no member named 'exc_type' in 'struct _err_stackitem'
  88. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  89. ~~~~~~~~ ^
  90. src/lxml/etree.c:261891:23: error: no member named 'exc_type' in 'struct _err_stackitem'
  91. *type = exc_info->exc_type;
  92. ~~~~~~~~ ^
  93. src/lxml/etree.c:261893:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  94. *tb = exc_info->exc_traceback;
  95. ~~~~~~~~ ^
  96. src/lxml/etree.c:261907:26: error: no member named 'exc_type' in 'struct _err_stackitem'
  97. tmp_type = exc_info->exc_type;
  98. ~~~~~~~~ ^
  99. src/lxml/etree.c:261909:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  100. tmp_tb = exc_info->exc_traceback;
  101. ~~~~~~~~ ^
  102. src/lxml/etree.c:261910:15: error: no member named 'exc_type' in 'struct _err_stackitem'
  103. exc_info->exc_type = type;
  104. ~~~~~~~~ ^
  105. src/lxml/etree.c:261912:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  106. exc_info->exc_traceback = tb;
  107. ~~~~~~~~ ^
  108. src/lxml/etree.c:261994:30: error: no member named 'exc_type' in 'struct _err_stackitem'
  109. tmp_type = exc_info->exc_type;
  110. ~~~~~~~~ ^
  111. src/lxml/etree.c:261996:28: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  112. tmp_tb = exc_info->exc_traceback;
  113. ~~~~~~~~ ^
  114. src/lxml/etree.c:261997:19: error: no member named 'exc_type' in 'struct _err_stackitem'
  115. exc_info->exc_type = local_type;
  116. ~~~~~~~~ ^
  117. src/lxml/etree.c:261999:19: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  118. exc_info->exc_traceback = local_tb;
  119. ~~~~~~~~ ^
  120. src/lxml/etree.c:262185:26: error: no member named 'exc_type' in 'struct _err_stackitem'
  121. tmp_type = exc_info->exc_type;
  122. ~~~~~~~~ ^
  123. src/lxml/etree.c:262187:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  124. tmp_tb = exc_info->exc_traceback;
  125. ~~~~~~~~ ^
  126. src/lxml/etree.c:262188:15: error: no member named 'exc_type' in 'struct _err_stackitem'
  127. exc_info->exc_type = *type;
  128. ~~~~~~~~ ^
  129. src/lxml/etree.c:262190:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  130. exc_info->exc_traceback = *tb;
  131. ~~~~~~~~ ^
  132. src/lxml/etree.c:264391:20: error: no member named 'exc_type' in 'struct _err_stackitem'
  133. t = exc_state->exc_type;
  134. ~~~~~~~~~ ^
  135. src/lxml/etree.c:264393:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  136. tb = exc_state->exc_traceback;
  137. ~~~~~~~~~ ^
  138. src/lxml/etree.c:264394:16: error: no member named 'exc_type' in 'struct _err_stackitem'
  139. exc_state->exc_type = NULL;
  140. ~~~~~~~~~ ^
  141. fatal error: too many errors emitted, stopping now [-ferror-limit=]
  142. 20 errors generated.
  143. Compile failed: command '/usr/bin/clang' failed with exit code 1
  144. creating var
  145. creating var/folders
  146. creating var/folders/6c
  147. creating var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn
  148. creating var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T
  149. cc -I/usr/include/libxml2 -c /var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.c -o var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.o
  150. cc var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInitlj7j8147.o -lxml2 -o a.out
  151. error: command '/usr/bin/clang' failed with exit code 1
  152. [end of output]
  153. note: This error originates from a subprocess, and is likely not a problem with pip.
  154. ERROR: Failed building wheel for lxml
  155. Running setup.py clean for lxml
  156. Failed to build lxml
  157. 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
  158. Attempting uninstall: pbr
  159. Found existing installation: pbr 1.6.0
  160. Uninstalling pbr-1.6.0:
  161. Successfully uninstalled pbr-1.6.0
  162. Attempting uninstall: oauthlib
  163. Found existing installation: oauthlib 3.2.2
  164. Uninstalling oauthlib-3.2.2:
  165. Successfully uninstalled oauthlib-3.2.2
  166. Attempting uninstall: lxml
  167. Found existing installation: lxml 4.9.2
  168. Uninstalling lxml-4.9.2:
  169. Successfully uninstalled lxml-4.9.2
  170. Running setup.py install for lxml ... error
  171. error: subprocess-exited-with-error
  172. × Running setup.py install for lxml did not run successfully.
  173. exit code: 1
  174. ╰─> [142 lines of output]
  175. Building lxml version 4.6.5.
  176. Building without Cython.
  177. Building against libxml2 2.9.13 and libxslt 1.1.35
  178. running install
  179. /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.
  180. warnings.warn(
  181. running build
  182. running build_py
  183. creating build
  184. creating build/lib.macosx-13-arm64-cpython-311
  185. creating build/lib.macosx-13-arm64-cpython-311/lxml
  186. copying src/lxml/_elementpath.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  187. copying src/lxml/sax.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  188. copying src/lxml/pyclasslookup.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  189. copying src/lxml/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  190. copying src/lxml/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  191. copying src/lxml/doctestcompare.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  192. copying src/lxml/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  193. copying src/lxml/cssselect.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  194. copying src/lxml/ElementInclude.py -> build/lib.macosx-13-arm64-cpython-311/lxml
  195. creating build/lib.macosx-13-arm64-cpython-311/lxml/includes
  196. copying src/lxml/includes/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  197. creating build/lib.macosx-13-arm64-cpython-311/lxml/html
  198. copying src/lxml/html/soupparser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  199. copying src/lxml/html/defs.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  200. copying src/lxml/html/_setmixin.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  201. copying src/lxml/html/clean.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  202. copying src/lxml/html/_diffcommand.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  203. copying src/lxml/html/html5parser.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  204. copying src/lxml/html/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  205. copying src/lxml/html/formfill.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  206. copying src/lxml/html/builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  207. copying src/lxml/html/ElementSoup.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  208. copying src/lxml/html/_html5builder.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  209. copying src/lxml/html/usedoctest.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  210. copying src/lxml/html/diff.py -> build/lib.macosx-13-arm64-cpython-311/lxml/html
  211. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
  212. copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron
  213. copying src/lxml/etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  214. copying src/lxml/etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  215. copying src/lxml/lxml.etree.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  216. copying src/lxml/lxml.etree_api.h -> build/lib.macosx-13-arm64-cpython-311/lxml
  217. copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  218. copying src/lxml/includes/c14n.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  219. copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  220. copying src/lxml/includes/__init__.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  221. copying src/lxml/includes/schematron.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  222. copying src/lxml/includes/tree.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  223. copying src/lxml/includes/uri.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  224. copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  225. copying src/lxml/includes/xpath.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  226. copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  227. copying src/lxml/includes/xslt.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  228. copying src/lxml/includes/config.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  229. copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  230. copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  231. copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  232. copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  233. copying src/lxml/includes/lxml-version.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  234. copying src/lxml/includes/etree_defs.h -> build/lib.macosx-13-arm64-cpython-311/lxml/includes
  235. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources
  236. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
  237. copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/rng
  238. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  239. copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  240. copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl
  241. creating build/lib.macosx-13-arm64-cpython-311/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  242. 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
  243. 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
  244. 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
  245. 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
  246. 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
  247. 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
  248. running build_ext
  249. building 'lxml.etree' extension
  250. creating build/temp.macosx-13-arm64-cpython-311
  251. creating build/temp.macosx-13-arm64-cpython-311/src
  252. creating build/temp.macosx-13-arm64-cpython-311/src/lxml
  253. 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
  254. src/lxml/etree.c:261877:23: error: no member named 'exc_type' in 'struct _err_stackitem'
  255. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  256. ~~~~~~~~ ^
  257. src/lxml/etree.c:261877:53: error: no member named 'exc_type' in 'struct _err_stackitem'
  258. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  259. ~~~~~~~~ ^
  260. src/lxml/etree.c:261891:23: error: no member named 'exc_type' in 'struct _err_stackitem'
  261. *type = exc_info->exc_type;
  262. ~~~~~~~~ ^
  263. src/lxml/etree.c:261893:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  264. *tb = exc_info->exc_traceback;
  265. ~~~~~~~~ ^
  266. src/lxml/etree.c:261907:26: error: no member named 'exc_type' in 'struct _err_stackitem'
  267. tmp_type = exc_info->exc_type;
  268. ~~~~~~~~ ^
  269. src/lxml/etree.c:261909:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  270. tmp_tb = exc_info->exc_traceback;
  271. ~~~~~~~~ ^
  272. src/lxml/etree.c:261910:15: error: no member named 'exc_type' in 'struct _err_stackitem'
  273. exc_info->exc_type = type;
  274. ~~~~~~~~ ^
  275. src/lxml/etree.c:261912:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  276. exc_info->exc_traceback = tb;
  277. ~~~~~~~~ ^
  278. src/lxml/etree.c:261994:30: error: no member named 'exc_type' in 'struct _err_stackitem'
  279. tmp_type = exc_info->exc_type;
  280. ~~~~~~~~ ^
  281. src/lxml/etree.c:261996:28: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  282. tmp_tb = exc_info->exc_traceback;
  283. ~~~~~~~~ ^
  284. src/lxml/etree.c:261997:19: error: no member named 'exc_type' in 'struct _err_stackitem'
  285. exc_info->exc_type = local_type;
  286. ~~~~~~~~ ^
  287. src/lxml/etree.c:261999:19: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  288. exc_info->exc_traceback = local_tb;
  289. ~~~~~~~~ ^
  290. src/lxml/etree.c:262185:26: error: no member named 'exc_type' in 'struct _err_stackitem'
  291. tmp_type = exc_info->exc_type;
  292. ~~~~~~~~ ^
  293. src/lxml/etree.c:262187:24: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  294. tmp_tb = exc_info->exc_traceback;
  295. ~~~~~~~~ ^
  296. src/lxml/etree.c:262188:15: error: no member named 'exc_type' in 'struct _err_stackitem'
  297. exc_info->exc_type = *type;
  298. ~~~~~~~~ ^
  299. src/lxml/etree.c:262190:15: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  300. exc_info->exc_traceback = *tb;
  301. ~~~~~~~~ ^
  302. src/lxml/etree.c:264391:20: error: no member named 'exc_type' in 'struct _err_stackitem'
  303. t = exc_state->exc_type;
  304. ~~~~~~~~~ ^
  305. src/lxml/etree.c:264393:21: error: no member named 'exc_traceback' in 'struct _err_stackitem'
  306. tb = exc_state->exc_traceback;
  307. ~~~~~~~~~ ^
  308. src/lxml/etree.c:264394:16: error: no member named 'exc_type' in 'struct _err_stackitem'
  309. exc_state->exc_type = NULL;
  310. ~~~~~~~~~ ^
  311. fatal error: too many errors emitted, stopping now [-ferror-limit=]
  312. 20 errors generated.
  313. Compile failed: command '/usr/bin/clang' failed with exit code 1
  314. cc -I/usr/include/libxml2 -c /var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.c -o var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.o
  315. cc var/folders/6c/d_lf625x5zn52yd5ytr2rf1c0000gn/T/xmlXPathInit9owg448l.o -lxml2 -o a.out
  316. error: command '/usr/bin/clang' failed with exit code 1
  317. [end of output]
  318. note: This error originates from a subprocess, and is likely not a problem with pip.
  319. Rolling back uninstall of lxml
  320. Moving to /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/lxml-4.9.2.dist-info/
  321. from /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/~xml-4.9.2.dist-info
  322. Moving to /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/lxml/
  323. from /Users/cauenapier/Documents/GitHub/vali/backend/myenv/lib/python3.11/site-packages/~xml
  324. error: legacy-install-failure
  325. × Encountered error while trying to install package.
  326. ╰─> lxml
  327. note: This is an issue with the package mentioned above, not pip.
  328. hint: See above for output from the failure.

答案1

得分: 1

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

  1. xcode-select --install

然后安装lxml:

  1. pip install lxml

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

  1. 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:

  1. xcode-select --install

And then instal lxml:

  1. 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:

  1. 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:

确定