使用 pip、easy_install、manual 安装 PyObjc 时遇到问题

Posted

技术标签:

【中文标题】使用 pip、easy_install、manual 安装 PyObjc 时遇到问题【英文标题】:Trouble installing PyObjc using pip, easy_install, manual 【发布时间】:2013-05-19 00:46:07 【问题描述】:

我在安装 PyObjC 时遇到了很多麻烦。我已经尝试过 pip、easy_install 和手动安装,但它们都给了我错误。我现在正在尝试使用 easy_install,因为它是 PyObjC 网站上推荐的。

要运行,我使用命令:

sudo env CC=clang easy_install -U pyobjc-core

我收到以下警告:

warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'

还有很多类似这样的错误:

/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h:180:53: error: expected function body after function declarator
CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree) CF_DEPRECATED(10_0, 10_8, 2_0, 6_0);

谁能帮我安装这个?

【问题讨论】:

您使用的是哪个 OSX 版本? 你能用你正在使用的编译器编译简单的C程序吗?您遇到的错误可能表明您的 devtools 安装已损坏。你在编译pyobjc-core时遇到的first错误是什么? (顺便说一句。我是 pyobjc 作者) 我也有很多遮阳篷 【参考方案1】:

根据您收到的错误,我会说您的编译器安装已损坏。

【讨论】:

【参考方案2】:

我试过了

env CC=clang pip install -U pyobjc-core
env CC=clang pip install -U pyobjc

这对我有用。还是有一些警告。喜欢每个包中的论文:

warning: no directories found matching 'Examples'
warning: no directories found matching 'Modules'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution

【讨论】:

以上是关于使用 pip、easy_install、manual 安装 PyObjc 时遇到问题的主要内容,如果未能解决你的问题,请参考以下文章

Python pip easy_install源配置

easy_install 和 pip

Scrapy 安装错误 pip 和 easy_install

python windows 下pip easy_install 使用错误的问题

easy_install与pip 区别

python 安装easy_install和pip