Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9276399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:50:36+00:00 2026-06-18T16:50:36+00:00

Currently, I am unable to install any Python packages due to a gcc-4.0 error.

  • 0

Currently, I am unable to install any Python packages due to a gcc-4.0 error. I’ll copy two examples of the error I’m getting (one with pip, the other with a manual setup.py build/install approach):

sgarza62$ pip install PIL
Downloading/unpacking PIL
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
  Running setup.py install for PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
    --- using frameworks at /System/Library/Frameworks
    building '_imaging' extension
    gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
    unable to execute gcc-4.0: No such file or directory
    error: command 'gcc-4.0' failed with exit status 1
    Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/9q/bvqtzkbx1hg1934b36zgk0y40000gp/T/pip-build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9q/bvqtzkbx1hg1934b36zgk0y40000gp/T/pip-nV9YEx-record/install-record.txt --single-version-externally-managed:
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py

running install

running build

running build_py

running build_ext

--- using frameworks at /System/Library/Frameworks

building '_imaging' extension

gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o

unable to execute gcc-4.0: No such file or directory

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

sgarza62$ cd Imaging-1.1.7
sgarza62$ sudo python setup.py build
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

Here is a bunch of information that I’ll copy from the terminal, hopefully some of it is helpful in identifying the problem:

sgarza62$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files

sgarza62$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:32:06)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

sgarza62$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

sgarza62$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

sgarza62$ /usr/bin/python -c 'import sys;print(sys.version)'
2.7.2 (default, Jun 16 2012, 12:38:40) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.6 -c 'import sys; print(sys.version)'
2.6.7 (r267:88850, Jun 16 2012, 12:38:45) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.5 -c 'import sys;print(sys.version)'
2.5.6 (r256:88840, Jun 16 2012, 12:38:24) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.7 -c 'import sys;print(sys.version)'
2.7.2 (default, Jun 16 2012, 12:38:40) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

Here are some questions/answers on stack that address the same or similar problems (but that did not provide a full solution to my problem). Maybe these previous answers will be of use in figuring out this problem:

Reinstalling python on Mac OS 10.6 with a different gcc version

How to use/install gcc on Mac OS X 10.8 / Xcode 4.4

Python build using wrong version of GCC on OS X


These are the things I have already done, which have been suggested be stack users for similar problems:

  • Download Xcode

  • Install Command Line Tools in the Xcode preferences

  • sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2


I’ve done my best in the question to give as many facts, in a clear and orderly way, as possible. However, if you guys need any more information, please ask! I will be happy to edit the question with more details.

Also, I know this appears to be a very specific question, but from searching around, it looks like many others are confused about this problem.

If you don’t mind, I would very much appreciate a spoon-fed solution (explicitly stating what I have to do in the Terminal to fix this). I am not very comfortable in the Terminal yet, and get a bit confused with generalized answers.

Thank you all for your time, I appreciate it!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:50:38+00:00Added an answer on June 18, 2026 at 4:50 pm

    The problem here is that you are trying to use the 32-bit-only python.org 2.7.3 on an OS X system with Xcode 4. The 32-bit-only installer was designed to be compatible across a number of OS X releases going back to 10.3.9. Unfortunately, with the removal of PPC support in Xcode 4 and various other changes made there, installing third-party Python packages that have C extension modules does not work out-of-the-box anymore on 10.7 and later systems with Xcode 4. It is possible to work around them, though. In the case of PIL, changing a couple of Python Distutils defaults through environment variables should do the trick:

    # override the default gcc-4.0 compiler and use clang instead
    $ export CC=clang
    # override the universal architectures to only use Intel-32
    $ export ARCHFLAGS='-arch i386'
    $ pip install PIL
    

    The python.org website provides two OS X installer variants for current Python releases. The Python provided by the other installer, the 64-bit/32-bit version, is configured for a smaller, newer range of systems; it does not support PPC and wouldn’t have this problem with Xcode 4.

    BTW, the next release of Python 2.7 (2.7.4) provides better support for Xcode 4 with both installers and should not have this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm unable to transition from index.html to any pages correctly. All transitions would show
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently working with converting SQLException error messages into messages that are more useful for
I'm currently creating a custom build of Android-gingerbread for one of my device by
I asked a question to install F# powerpack and use it here . error
Currently PHP 5.3 hosting environments have to install and use Zend Guard Loader extension
I'm currently trying to install a few modules via virtualenv , which I have
I am unable to install lots of extensions to Visual Studio 11 Dev. Preview.
I have a private Rails app that I'm trying to install locally. It's currently
I'm installing EPIC within eclipse but always get an error: Unable to read repository

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.