3

I tried installing lxml on Mac OSX Snowleopard and keep getting the error:

lipo: can't figure out the architecture type of: /var/folders/

I did install XCode with 10.4 SDK support and I changed gcc 4.2 to 4.0.1

Any clues??? Python 2.6.1 with Leopard 1.6.7..

running install
running bdist_egg
running egg_info
writing src/lxml.egg-info/PKG-INFO
writing top-level names to src/lxml.egg-info/top_level.txt
writing dependency_links to src/lxml.egg-info/dependency_links.txt
reading manifest file 'src/lxml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'src/lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src/lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src/lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src/lxml'
warning: no files found matching '*.html' under directory 'doc'
writing manifest file 'src/lxml.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-universal/egg
running install_lib
running build_py
running build_ext
building 'lxml.etree' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/usr/include/libxml2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-universal-2.6/src/lxml/lxml.etree.o -w -flat_namespace
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
powerpc-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
powerpc-apple-darwin10-gcc-4.2.1: no input files
i686-apple-darwin10-gcc-4.2.1: src/lxml/lxml.etree.c: No such file or directory
i686-apple-darwin10-gcc-4.2.1: no input files
lipo: can't figure out the architecture type of: /var/tmp//ccCwMxyq.out
error: command 'gcc-4.2' failed with exit status 1
dev3928
  • 51
  • 1
  • 4
  • We can't see your error message. If you're being generic when you say (I) 'keep getting this error message', then you need to post the error message. Might help also to post the paths you are/have tried to install to. Good Luck. – shellter Jun 12 '11 at 03:20
  • @shelter I believe dev3928 was referring to the text in the title as the error message. – Shawn Chin Jun 13 '11 at 14:20
  • Please post the command you ran, the entire error message and preferably the entire build output. `/var/folders` is the beginning of the path to `$TMPDIR`, so you haven't even posted the entire line! Also, please mention what version of Python you're using and what version of OS X. – Nicholas Riley Jun 13 '11 at 14:28
  • Added the error lines, seems gcc is still looking for a version 4.2 while.. How do I point it to use 4.0.1 instead ? I tried using a symlink.. – dev3928 Jun 14 '11 at 07:36

3 Answers3

0

you have an architecture problem for your python, Because of changes in Xcode 4 (dropping of support for the 10.4u SDK and gcc-4.0) it is not practical to build C extension modules with that Python on 10.7 Lion. Either use the Apple-supplied Python 2.7

/usr/bin/python2.7

Install the Python 2.7.3 Mac OS X 64-bit/32-bit x86-64/i386 Installer

  • AKA this: http://stackoverflow.com/questions/6839795/cant-figure-out-the-architecture-type-of-problem-when-compiling-python – Matt Dodge Jan 31 '17 at 17:19
0

I was having the same issue while trying to install milk with Python 2.7. I was not able to get my problem solved with Ali Elouafiq's exact answer, but I was able to get milk installed using the systems Python 2.6.

So perhaps trying other versions of Python until in case it works is a cost effective approach.

Climbs_lika_Spyder
  • 6,004
  • 3
  • 39
  • 53
0

I found that compilation issues like these are easily avoided by installing python via brew. If brew isn't able to link the formula, just force it with:

brew link --overwrite python

See also: http://docs.python-guide.org/en/latest/starting/install/osx/

kgriffs
  • 4,080
  • 5
  • 37
  • 42