unstructured 包安装报错 Building wheel for lxml (pyproject.toml) did not run successfully.
·
现象:
在2025-06-27 安装 unstructured 包时,报错Building wheel for lxml (pyproject.toml) did not run successfully.
报错信息
Building wheel for lxml (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [4856 lines of output]
Building lxml version 6.0.0.
Building without Cython.
Building against libxml2 2.9.1 and libxslt 1.1.28
running bdist_wheel
running build
running build_py
…………
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Failed to build lxml
ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects
Python版本
python 3.8
unstructured版本
unstructured==0.11.8
原因
在2025-06-27 lxml更新了6.0 版本,unstructured安装lxml依赖时没指定包版本,安装了lxml的6.0版本,但是lxml构建失败导致安装unstructured报错
解决方法
在unstructured安装前指定lxml版本(上一个版本为lxml == 5.4.0
),如:
lxml==5.4.0
unstructured==0.11.8
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)