无法与easy_install的安装或画中画开启MAC(Unable to Install with

2019-09-17 08:38发布

我想使用的easy_install(画中画),但收到错误消息像安装LXML和pycrypto模块

Running lxml-2.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kGsWMh/lxml-2.3.4/egg-dist-tmp-Gjqy3f
Building lxml version 2.3.4.
Building without Cython.
Using build configuration of libxslt 1.1.24
In file included from /usr/include/limits.h:63,
                 from /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.0.1/include/limits.h:10,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:19,
                 from src/lxml/lxml.etree.c:4:
/usr/include/sys/cdefs.h:540:4: error: #error Unknown architecture
In file included from /usr/include/limits.h:64,
                 from /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.0.1/include/limits.h:10,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:19,
                 from src/lxml/lxml.etree.c:4:
/usr/include/machine/limits.h:10:2: error: #error architecture not supported
In file included from /usr/include/sys/_types.h:33,
                 from /usr/include/_types.h:27,
                 from /usr/include/stdio.h:67,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:33,
                 from src/lxml/lxml.etree.c:4:
/usr/include/machine/_types.h:36:2: error: #error architecture not supported
In file included from /usr/include/_types.h:27,
                 from /usr/include/stdio.h:67,
                 from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:33,
                 from src/lxml/lxml.etree.c:4:
/usr/include/sys/_types.h:94: error: syntax error before ‘__darwin_blkcnt_t’
    src/lxml/lxml.etree.c:165640: error: syntax error before ‘val’
    src/lxml/lxml.etree.c:165645: error: syntax error before ‘val’

喇嘛喇嘛。 。 。

src/lxml/lxml.etree.c:165645: error: syntax error before ‘val’

lipo: can't figure out the architecture type of: /var/folders/f3/2q2x2p015kzgd4nbrn_qwykh0000gn/T//cc1pnrww.out

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

我得到类似的语法错误,当我尝试安装pycrypto为好。 我想这个答案 ,但徒劳无功。 我试着设置了为Python 2.6,并使用setuptools的-0.6c11-py2.6.egg和setuptools的-0.6c11-py2.7.egg 2.7环境,但得到相同的输出。

我搜索了很多网上,但无法找到这个解决方案。

编辑:我在OSX 10.7上的MacBook Pro 2010和XCode的4和3安装有

我倒是ARGS与最新版本取代,而试图在上面的链接的命令。

python setup.py build --static-deps --libxml2-version=2.7.8  --libxslt-version=1.1.26 
sudo python setup.py install

我读了一些其它岗位,并试图以此为好

STATIC_DEPS=true sudo easy_install --allow-hosts=lxml.de,*.python.org lxml

解:

作为@jdi建议我做了以下

$ brew install --use-llvm libxml2
$ brew install --use-llvm libxslt

安装了gcc的链接 ,因为我仍在为选择1和2面临的问题建议

然后,用户可以在本

$ export ARCHFLAGS="-arch i386 -arch x86_64"
$ /usr/bin/python2.6 setup.py build
$ sudo /usr/bin/python2.6 setup.py install

或者这一点,将工作

$ sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install-2.6 lxml

同样就职于pycrypto以及

Answer 1:

这里这项权利是,你是不正确构建它指示: /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10 ,当然,除非你是一个老的PowerPC机器上。

检查你正在运行OSX的版本,并且使用的是建立lxml的命令。 有可能到头来你可能需要设置export ARCHFLAGS="-arch i386 -arch x86_64"建设前的壳,以避免其与建筑ppc 。 不知道为什么你越来越老牌坊。

此外,请确保你已经安装了最新的Xcode。 而且,如果你是以下这个链接你贴出来,一个字一个字,请确保您使用的是最新的版本的软件包,而不是字面的版本作为链接是3岁。

如果一切都失败了,安装自制软件并通过包管理器进行安装。

更新:选项缺少GCC 4.2的XCode 4.2以上版本更新后

选一个

  1. 使用这个简单的指南安装gcc 4.2:
    http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42

  2. 使用自制软件进行安装:

    brew tap homebrew/dupes
    brew install homebrew/dupes/apple-gcc42

  3. 完全无视gcc和使用LLVM与BREW

    brew install --use-llvm libxml2



文章来源: Unable to Install with easy_install or pip on mac