Python 在安装Scrapy时,gcc-4.0在mac 10.6.8上失败。我如何克服这一问题?

Python 在安装Scrapy时,gcc-4.0在mac 10.6.8上失败。我如何克服这一问题?,python,pip,scrapy,Python,Pip,Scrapy,我在Mac10.6.8上使用了pip安装Scrapy,我得到了下面的错误 有人能帮我吗 creating build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport copying twisted/internet/iocpreactor/iocpsupport/iocpsupport.c -> build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreact

我在Mac10.6.8上使用了pip安装Scrapy,我得到了下面的错误 有人能帮我吗

creating build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport

copying twisted/internet/iocpreactor/iocpsupport/iocpsupport.c ->
build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport

copying twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c ->
build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport

copying twisted/python/_epoll.c ->
build/lib.macosx-10.3-fat-2.7/twisted/python

copying twisted/python/_initgroups.c ->
build/lib.macosx-10.3-fat-2.7/twisted/python

copying twisted/runner/portmap.c ->
build/lib.macosx-10.3-fat-2.7/twisted/runner

copying twisted/test/raiser.c ->
build/lib.macosx-10.3-fat-2.7/twisted/test

running build_ext

gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386
-g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c conftest.c -o conftest.o

/usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as: assembler
(/usr/bin/../libexec/gcc/darwin/ppc/as or
/usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not
installed

Installed assemblers are:

/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64

/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

lipo: can't open input file:
/var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk+++TI/-Tmp-//ccBIdB4l.out (No
such file or directory)

gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386
-g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c conftest.c -o conftest.o

conftest.c:1:23: error: sys/epoll.h: No such file or directory

conftest.c:1:23: error: sys/epoll.h: No such file or directory

lipo: can't figure out the architecture type of:
/var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk+++TI/-Tmp-//cceIymsT.out

building 'twisted.test.raiser' extension

creating build/temp.macosx-10.3-fat-2.7

creating build/temp.macosx-10.3-fat-2.7/twisted

creating build/temp.macosx-10.3-fat-2.7/twisted/test

gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386
-g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c twisted/test/raiser.c -o build/temp.macosx-10.3-fat-2.7/twisted/test/raiser.o

In file included from /usr/include/architecture/i386/math.h:626,

                 from /usr/include/math.h:28,

                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:312,

                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,

                 from twisted/test/raiser.c:4:

/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building
for Intel with Mac OS X Deployment Target < 10.4 is invalid.

/usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as: assembler
(/usr/bin/../libexec/gcc/darwin/ppc/as or
/usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not
installed

Installed assemblers are:

/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64

/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

lipo: can't open input file:
/var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk+++TI/-Tmp-//ccNvrcyZ.out (No
such file or directory)

error: command 'gcc-4.0' failed with exit status 1

---------------------------------------- Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-c "import setuptools;__file__='/Users/bbb/Dropbox/projects/android/continuous-integration/build/Twisted/setup.py';exec(compile(open(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --single-version-externally-managed
--record /var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk+++TI/-Tmp-/pip-MXEZuX-record/install-record.txt
failed with error code 1 Storing complete log in
/Users/bbb/.pip/pip.log
创建build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport
复制twisted/internet/iocpreactor/iocpsupport/iocpsupport.c->
build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport
正在复制twisted/internet/iocpreactor/iocpsupport/winsock_指针。c->
build/lib.macosx-10.3-fat-2.7/twisted/internet/iocpreactor/iocpsupport
正在复制twisted/python/_epoll.c->
build/lib.macosx-10.3-fat-2.7/twisted/python
正在复制twisted/python/_initgroups.c->
build/lib.macosx-10.3-fat-2.7/twisted/python
正在复制twisted/runner/portmap.c->
build/lib.macosx-10.3-fat-2.7/twisted/runner
复制扭曲/测试/提升器。c->
build/lib.macosx-10.3-fat-2.7/twisted/test
运行build_ext
gcc-4.0-fno严格混叠-fno通用-动态-拱门ppc-拱门i386
-g-O2-DNDEBUG-g-O3-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-c conftest.c-o conftest.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as:assembler
(/usr/bin/。/libexec/gcc/darwin/ppc/as或
/usr/bin/。/local/libexec/gcc/darwin/ppc/as)用于架构ppc
安装
已安装的汇编程序包括:
/usr/bin/./libexec/gcc/darwin/x86_64/as用于体系结构x86_64
/usr/bin/./libexec/gcc/darwin/i386/as用于体系结构i386
lipo:无法打开输入文件:
/var/folders/jk/jktyaffdwec8fvzts+C7Jwk+++TI/-Tmp-///ccBIdB4l.out(编号
此类文件或目录)
gcc-4.0-fno严格混叠-fno通用-动态-拱门ppc-拱门i386
-g-O2-DNDEBUG-g-O3-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-c conftest.c-o conftest.o
conftest.c:1:23:错误:sys/epoll.h:没有这样的文件或目录
conftest.c:1:23:错误:sys/epoll.h:没有这样的文件或目录
lipo:无法确定以下架构类型:
/var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk+++TI/-Tmp-//cceIymsT.out
建筑“扭曲。测试。提升器”扩展
创建构建/临时macosx-10.3-fat-2.7
创建build/temp.macosx-10.3-fat-2.7/twisted
创建build/temp.macosx-10.3-fat-2.7/twisted/test
gcc-4.0-fno严格混叠-fno通用-动态-拱门ppc-拱门i386
-g-O2-DNDEBUG-g-O3-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-c twisted/test/raiser.c-o build/temp.macosx-10.3-fat-2.7/twisted/test/raiser.o
在/usr/include/architecture/i386/math.h:626中包含的文件中,
from/usr/include/math.h:28,
从/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:312,
从/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,
来自扭曲/测试/提升器。c:4:

/usr/include/AvailabilityMacros.h:108:14:警告:#警告建筑 对于Mac OS X部署目标<10.4的英特尔,此选项无效。 /usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as:assembler (/usr/bin/。/libexec/gcc/darwin/ppc/as或 /usr/bin/。/local/libexec/gcc/darwin/ppc/as)用于架构ppc 安装 已安装的汇编程序包括: /usr/bin/./libexec/gcc/darwin/x86_64/as用于体系结构x86_64 /usr/bin/./libexec/gcc/darwin/i386/as用于体系结构i386 lipo:无法打开输入文件: /var/folders/jk/jktyaffdwec8fvzts+C7Jwk+++TI/-Tmp-///ccNvrcyZ.out(否 此类文件或目录) 错误:命令“gcc-4.0”失败,退出状态为1 ----------------------------------------Command/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c“导入setuptools;uuuu文件uuuu=”/Users/bbb/Dropbox/projects/android/continuous integration/build/Twisted/setup.py';exec(编译(打开(uuuu文件).read().replace(“\r\n”, “\n'),_文件_,'exec')”安装--外部管理的单一版本 --record/var/folders/jk/jktyaffdwec8fvzts+C7Jwk+++TI/-Tmp-/pip MXEZuX record/install-record.txt 存储完整登录失败,错误代码为1 /Users/bbb/.pip/pip.log
pip安装python软件包。这些python包依赖于c库,c库应该由包管理器安装,而不是由pip安装

查看输出时,您缺少几个包的头文件。我能发现这些,还有更多

conftest.c:1:23: error: sys/epoll.h: No such file or directory

include/python2.7/pyport.h:312
在ubuntu上,在软件包管理器中可以看到:
python开发
epoll开发
包。但是osx可能有一个简单的方法来实现


或者,您可以为您的osx寻找一个预编译包。

看来您已经安装了Xcode 4,它删除了用于构建已安装的Python 2.7的
gcc-4.0
。从回溯中的路径名来看,很可能是从Python.org下载的32位纯Python。对于Xcode 4,您应该尝试安装。然后,您可能需要重新安装已安装的任何软件包,如
Distribute
pip
和依赖项。根据Xcode 4的版本,在运行
pip
easy\u install
之前,您可能还需要提供以下环境变量设置:

export CC=gcc

嗨,我从python.org下载了python27 dmg,然后pip安装了Scrapy,我得到了这个:$pip安装Scrapy setuptools__文件_u_='/Users/bbb/Dropbox/projects/android/continuousintegration/build/Twisted/setup.py';exec(编译(打开(文件).read().replace('\r\n','\n'),文件'exec'))“安装--外部管理的单一版本--record/var/folders/jk/jkTyAFDWEC8fvZts+C7Jwk++TI/-Tmp-/pip-J88r8N-record/install-record.txt失败,错误代码1存储完整的登录/Users/tomerb/.pip/pip.logusr/include/AvailabilityMacros.h:108:14:警告:#针对Mac OS X部署目标<10.4的英特尔构建警告无效/usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as:assembler(/usr/bin/。/libexec/gcc/darwin/ppc/as或/usr/bin/。/local/libexec/gcc/darwin/ppc/as)对于体系结构ppc未安装已安装的汇编程序是:/usr/bin/。/libexec/gcc/darwin/x8664/as对于体系结构x