python - MacOS X 上的 pip install lxml 给出错误 : command 'cc' failed

标签 python python-2.7 lxml

我正在尝试在我的 Mac Mac OS X El Capitan 中安装 lxml。 (五 - 10.11.6)。 但是我不想在我的 mac 上安装 xcode。

当我尝试使用以下命令时: pip 安装 lxml

我收到错误:错误:命令“cc”失败,退出状态为 1

如何在我的 mac 中安装 lxml 而无需安装 xcode?

最佳答案

您不必安装 XCode,只需安装 XCode 工具即可。这些指南应该可以帮助您进行配置:

摘自第一篇文章:

Installing development-related software in the past has required the compiler tool-chain that comes with Xcode. Thankfully, if you don’t need or want Xcode, those compiler tools are now available separately, saving download time and many gigabytes of disk space.

关于python - MacOS X 上的 pip install lxml 给出错误 : command 'cc' failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44067984/

相关文章:

Python - 获取windows文件夹ACL权限

python - 为什么有些图像有第三维,而其他图像有 4?

python - 如何将这种类型的数据 <hdf5 object reference> 转换为在 python 中更具可读性的内容?

python - lxml 更改 Unicode 字符

python - 将 'xml:space' 设置为 'preserve' Python lxml

python - 从 anchor 标记的 xpath 节点获取 2 属性的值

python - 用 BeautifulSoup 解析表并写入文本文件

python - 如何使用混合数据类型值迭代 DF[ 'column']?

python - 如何在Python(Jinja2)中单击“导出”按钮下载文件?

postgresql - 为什么 psycopg2 和 pyodbc 以不同方式连接到数据库?我如何翻译连接?