在Mac OSX 10.9.2上安装Scrapy时出错

0 投票
1 回答
694 浏览
提问于 2025-04-18 05:56

每次我尝试为一个使用scrapy的Python项目安装所需的包时,都会出现以下错误。

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hqp6xc-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Storing debug log for failure in /Users/MichaelBoydBrowne/Library/Logs/pip.log

我试过用sudo来安装,但还是不行。请告诉我可能出什么问题了。如果有帮助的话,我在尝试其他Python相关的安装时也遇到了类似的错误。

1 个回答

2

你可能没有安装Xcode的命令行工具。试着运行这个命令:

xcode-select --install

撰写回答