title: OSX: error when installing python packages
body: <p><strong>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 <em>pip</em>, the other with a manual setup.py build/install approach):</strong></p>
  
  <pre><code>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
  </code></pre>
  
  <hr>
  
  <pre><code>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
  </code></pre>
  
  <hr>
  
  <p><strong>Here is a bunch of information that I'll copy from the terminal, hopefully some of it is helpful in identifying the problem:</strong></p>
  
  <pre><code>sgarza62$ gcc
  i686-apple-darwin11-llvm-gcc-4.2: no input files
  </code></pre>
  
  <hr>
  
  <pre><code>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.
  &gt;&gt;&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>sgarza62$ which python
  /Library/Frameworks/Python.framework/Versions/2.7/bin/python
  </code></pre>
  
  <hr>
  
  <pre><code>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
  </code></pre>
  
  <hr>
  
  <pre><code>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)]
  </code></pre>
  
  <hr>
  
  <p><strong>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:</strong></p>
  
  <p><a href="https://stackoverflow.com/q/3500638/1337422">Reinstalling python on Mac OS 10.6 with a different gcc version</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9353444/how-to-use-install-gcc-on-mac-os-x-10-8-xcode-4-4">How to use/install gcc on Mac OS X 10.8 / Xcode 4.4</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5944228/python-build-using-wrong-version-of-gcc-on-os-x">Python build using wrong version of GCC on OS X</a></p>
  
  <hr>
  
  <p><strong>These are the things I have already done, which have been suggested be stack users for similar problems:</strong></p>
  
  <ul>
  <li><p>Download Xcode</p></li>
  <li><p>Install Command Line Tools in the Xcode preferences</p></li>
  <li><p><code>sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2</code></p></li>
  </ul>
  
  <hr>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Thank you all for your time, I appreciate it!</p>