c++ - 使用 gcc 4.2 在 Mac OS X 10.6.8 上安装 lxml

标签 c++ python macos gcc lxml

<分区>

我已经使用 osx-gcc-installer 在 Mac OS X 10.6.8 上安装了 gcc .下载 XCode 需要很长时间,但我设法下载并安装了这个 170-Mb 的包,并且我能够使用 iostream 编译一个 Hello, world! 程序>std::cout.

然后我尝试使用 python 的 easy_install lxml 安装 lxml。它找不到 gcc-4.0。我添加了一个指向 gcc-4.2gcc-4.0 符号链接(symbolic link)。这就是我得到的,感谢任何帮助:

(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

最佳答案

尝试建议的解决方案here :

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

关于c++ - 使用 gcc 4.2 在 Mac OS X 10.6.8 上安装 lxml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19557304/

相关文章:

c++ - 为什么 lambda 的大小为 1 个字节?

python - Tweepy - 如何从转推中找到原始推文 ID?

python - Scikit-learn 分类 : binomial log regression?

macos - WiFi:OS X称“device”是什么?

c++ - 检查几个组合框的索引是否唯一

c++ - 如何将模板从 C++ 转换为 C

python - 从 noses setup package() 迁移到 pytest

macos - 在 Mac OS X Mavericks 上设置 Kibana

c++ - 在 OSX 上构建巨大的 C++ 源代码时出现 LLVM Clang 6.0 fatal error

c++ - 为什么我的 AMD CPU 在编译应用程序时遇到问题?