0

ive had this issue with PIL and reportlab so far. the issue is that the install fails with

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

i've found a fix, in this document paikialog

question is,

why does the ARCHFLAGS="-arch i386 -arch x86_64" fix the issue? whats it doing? and how can i force that globally so i dont have to use it every time i try to add a module that needs compiling?

bytejunkie
  • 1,003
  • 14
  • 30
  • How are you installing these modules? Generally, using `easy_install` or `pip` takes care of this stuff for you. The problem is that Python on Mac OS X 10.6 is _really, really_ broken. The path of least resistance is to install a version of Python from python.org. I like fiddling with things, and I've managed to get most things to build on the default Python, but it's not easy and often very unpleasant. – Chinmay Kanchi Jul 18 '11 at 22:37
  • The Apple-supplied Python 2.6 on OS X isn't really, really broken. It works fine for most things (don't use it for Tkinter or IDLE, though). What is broken is that installing Xcode 4 makes life difficult because it no longer includes support for PPC architecture, one of the archs that that Python was built with and, hence, one of the archs that Distutils will attempt to build C extension modules with. That said, you are better off using a more up-to-date Python and one that avoids the PPC issues, assuming you don't need backward compatibility with previous OS X releases and hw. – Ned Deily Jul 19 '11 at 07:39

2 Answers2

1

The explanation is here. You could avoid the problem by installing Xcode 3 instead of Xcode 4. Or, better, you can avoid the problem by installing another Python instance that does not include the PPC arch; a good choice is the current Python 2.7.2 64-/32-bit installer from python.org.

Community
  • 1
  • 1
Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • thanks for the answer. succinct and easy to understand. can't upgrade my python til the server is upgraded, but will make it a priority to look into it. – bytejunkie Jul 19 '11 at 13:29
0

I suggest using MacPorts which allows the simple installation of almost all available python libraries.

schlamar
  • 9,238
  • 3
  • 38
  • 76