在带有gcc 4.2的Mac OS X 10.6.8上安装lxml [英] Installing lxml on Mac OS X 10.6.8 with gcc 4.2

查看:79
本文介绍了在带有gcc 4.2的Mac OS X 10.6.8上安装lxml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 osx-gcc-installer <在Mac OS X 10.6.8上安装了gcc .下载XCode将花费很多时间,但是我设法下载并安装了这个170 Mb的程序包,并且能够使用iostreamstd::cout编译Hello, world!程序.

I've installed gcc on Mac OS X 10.6.8 using the osx-gcc-installer. Downloading XCode would take forever, but I managed to download and install this 170-Mb package, and I am able to compile a Hello, world! program using iostream and std::cout.

然后我尝试使用python的easy_install lxml安装lxml.找不到gcc-4.0.我添加了指向gcc-4.2gcc-4.0符号链接.这就是我得到的,任何帮助,我们都感激不尽:

Then I tried to install lxml using python's easy_install lxml. It couldn't find gcc-4.0. I added a symbolic link of gcc-4.0 pointing to gcc-4.2. Then this is what I get, any help appreciated:

(web)Mac-Owners-MacBook-Pro-2:python root# ./web/bin/easy_install lxml
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.2.3
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.2.3.tar.gz#md5=fef47bb4ac72ac38ce778518dac42236
Processing lxml-3.2.3.tar.gz
Writing /tmp/easy_install-5g5OTc/lxml-3.2.3/setup.cfg
Running lxml-3.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5g5OTc/lxml-3.2.3/egg-dist-tmp-Rqqb9w
Building lxml version 3.2.3.
Building without Cython.
Using build configuration of libxslt 1.1.28
Building against libxml2/libxslt in the following directory: /opt/local/lib
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url'
  warnings.warn(msg)
warning: no files found matching '*.txt' under directory 'src/lxml/tests'
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_4XSLT_18__call__’:
src/lxml/lxml.etree.c:140541: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__copyXSLT’:
src/lxml/lxml.etree.c:141947: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.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
In file included from /usr/include/architecture/i386/math.h:626,
                 from /usr/include/math.h:28,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
                 from src/lxml/lxml.etree.c:16:
/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_4XSLT_18__call__’:
src/lxml/lxml.etree.c:140541: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__copyXSLT’:
src/lxml/lxml.etree.c:141947: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type
lipo: can't open input file: /var/tmp//ccXL5TAi.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1

推荐答案

请尝试在此处:

sudo ARCHFLAGS="-arch i386 -arch x86_64" pip install lxml

这篇关于在带有gcc 4.2的Mac OS X 10.6.8上安装lxml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆