首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >osx python setup.py不会安装xattr-0.6.1应用程序

osx python setup.py不会安装xattr-0.6.1应用程序
EN

Stack Overflow用户
提问于 2011-05-05 05:29:50
回答 1查看 1.1K关注 0票数 0

我是svn和python的新手,但我真的想使用更新版本的xattr,它包含比操作系统附带的原始版本更有用的特性。

在OSX 10.5.6上,我在安装xattr-0.6.1时遇到问题。

在终端的本地机器上:

代码语言:javascript
复制
$ svn co http://svn.red-bean.com/bob/xattr/releases/xattr-0.6.1/

下载这些文件并将其放在~/xattr-0.6.1/中

代码语言:javascript
复制
$ cd xattr-0.6.1/
$ sudo python setup.py install

---------------------------------------------------------------------------
This script requires setuptools version 0.6c11 to run (even to display
help).  I will attempt to download it for you (from
http://pypi.python.org/packages/2.5/s/setuptools/), but
you may need to enable firewall access for this script first.
I will start the download in 15 seconds.

(Note: if this machine does not have network access, please obtain the file

   http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg

and place it in this directory before rerunning this script.)
---------------------------------------------------------------------------
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
running install
running bdist_egg
running egg_info
creating xattr.egg-info
writing xattr.egg-info/PKG-INFO
writing top-level names to xattr.egg-info/top_level.txt
writing dependency_links to xattr.egg-info/dependency_links.txt
writing entry points to xattr.egg-info/entry_points.txt
writing manifest file 'xattr.egg-info/SOURCES.txt'
writing manifest file 'xattr.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.5-i386/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.5-i386-2.5
creating build/lib.macosx-10.5-i386-2.5/xattr
copying xattr/__init__.py -> build/lib.macosx-10.5-i386-2.5/xattr
copying xattr/constants.py -> build/lib.macosx-10.5-i386-2.5/xattr
copying xattr/tool.py -> build/lib.macosx-10.5-i386-2.5/xattr
running build_ext
building 'xattr._xattr' extension
creating build/temp.macosx-10.5-i386-2.5
creating build/temp.macosx-10.5-i386-2.5/xattr
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c xattr/_xattr.c -o build/temp.macosx-10.5-i386-2.5/xattr/_xattr.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1

要检查python版本,请执行以下操作:

代码语言:javascript
复制
$ python -V
Python 2.5.1

它似乎已经安装了python更新。

我尝试再次运行xattr安装:

代码语言:javascript
复制
$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing xattr.egg-info/PKG-INFO
writing top-level names to xattr.egg-info/top_level.txt
writing dependency_links to xattr.egg-info/dependency_links.txt
writing entry points to xattr.egg-info/entry_points.txt
writing manifest file 'xattr.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.5-i386/egg
running install_lib
running build_py
running build_ext
building 'xattr._xattr' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c xattr/_xattr.c -o build/temp.macosx-10.5-i386-2.5/xattr/_xattr.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1

我是不是遗漏了一个重要的基本元素,或者是setup.py配置出了什么问题,或者我可能忽略了其他什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-05-05 06:09:24

它需要编译一个C文件,所以它需要gcc。Mac用户需要安装XCode。正如@提到的那样,你应该有一个随你的附带的XCode安装DVD盘(很可能是3.2版)。

例如:

代码语言:javascript
复制
atlas% which gcc
/usr/bin/gcc
atlas% gcc -v
Target: i686-apple-darwin10
..
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5890085

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档