gpt4 book ai didi

python - 无法导入 python-goose (OSX 10.9)

转载 作者:太空宇宙 更新时间:2023-11-03 18:32:00 25 4
gpt4 key购买 nike

我正在尝试在 virtualenv 中正确设置 python-goose。

更新:我对 python 进行了核攻击,并按照概述 here 开始进行全新安装。 .

我关注了 python-goose instructions并做了:

mkvirtualenv --no-site-packages goose
git clone https://github.com/grangier/python-goose.git
cd python-goose
pip install -r requirements.txt
python setup.py install

pip install -rrequirements.txtlxml 上失败

我现在得到的错误是:

error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /Users/me/.virtualenvs/goose/bin/python -c "import setuptools, tokenize;__file__='/Users/me/.virtualenvs/goose/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/wg/82j6ndq50tl4m9rjkqszyx8r0000gp/T/pip-c9DtYT-record/install-record.txt --single-version-externally-managed --compile --install-headers
/Users/me/.virtualenvs/goose/include/site/python2.7 failed with error code 1 in
/Users/me/.virtualenvs/goose/build/lxml

我是否做错了什么,或者有什么其他方法可以尝试使其正常工作?

最佳答案

终于找到解决办法了:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

这个错误似乎是由 Xcode 5.1 附带的 Apple 最新 clang 更新引起的

"Update: Did not expect this to get so much attention, but here's more detail: the clang 3.4 Apple is shipping defaults to erroring on unknown flags, but CPython builds modules using the same set of flags it was compiled with originally. The system CPython was compiled with several flags that are unknown by clang, thus causing this problem."

在此处了解更多信息:https://stackoverflow.com/a/22315129/2673189

再次感谢 Wolph 和pseudocubic,你们非常有帮助。

关于python - 无法导入 python-goose (OSX 10.9),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22254704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com