Cannot install using easy_install or pip on mac

I am trying to install lxml and pycrypto modules with easy_install (and pip) but I get error messages like

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โ€™

bla bla.,.

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

I get similar syntax errors when I try to install pycrypto. I tried this answer , but in vain. I tried setting up my python 2.6 and 2.7 environment using setuptools-0.6c11-py2.6.egg and setuptools-0.6c11-py2.7.egg, but getting the same result.

I searched a lot online, but could not find a solution for this.

EDIT: I'm on OSX 10.7 on macbook pro 2010 and you have Xcode 4 and 3 installed

I would say that I replaced the latest version by trying the commands in the link above.

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

I read about another post and tried this as well

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

Decision:

Since @ jdi suggested that I did the following

$ 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

+1
1

, : /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin10, , , powerpc.

OSX, , , lxml. , export ARCHFLAGS="-arch i386 -arch x86_64" , , ppc. , .

, , Xcode. , , , , , , , 3 .

, homebrew .

: GCC 4.2 XCode 4.2+

+2

All Articles