安装lxm时出错

2024-06-08 18:19:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试用pip安装lxml。我在运行脚本时收到此初始错误:

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

快速搜索上述错误(例如here)发现我需要安装lxml。你知道吗

在尝试安装lxml时,我收到以下错误:

clang: error: unknown argument: '-mno-fused-madd'

error: command 'cc' failed with exit status 1

你知道怎么回事吗?你知道吗


Tags: pipthe脚本youtree错误withbuilder
1条回答
网友
1楼 · 发布于 2024-06-08 18:19:16

根据Xcode 5 Release Notes

The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.

...

To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning. For example, you can install a Python native extension with:

$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future \
  easy_install ExtensionName

在安装lxml之前设置以下环境变量:

export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

相关问题 更多 >