title: Missing gcc-4.0 error on pip install twisted in virtual env
body: <p>I'm trying to use Scrapy inside a virtualenv, which requires installation of twisted as well.  I did <code>pip install Scrapy</code> with no problems, but when I try <code>pip install twisted</code>, I'm getting the following error multiple times in the output:</p>
  
  <pre><code>unable to execute gcc-4.0: No such file or directory
  
  error: command 'gcc-4.0' failed with exit status 1
  </code></pre>
  
  <p>I previously had a similar problem when trying to install python packages on my actual system, which is why I started using virtualenv in the first place.  Is this an issue of the python version installed on my environment?  This is what I currently have:</p>
  
  <pre><code>Django          - 1.5          - active 
  Python          - 2.7.3        - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
  Scrapy          - 0.16.4       - active 
  pip             - 1.2.1        - active 
  setuptools      - 0.6c11       - active 
  wsgiref         - 0.1.2        - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
  yolk            - 0.4.3        - active
  </code></pre>
  
  <p>To check which version of gcc I have I typed <code>gcc</code> at the command line and got </p>
  
  <pre><code>i686-apple-darwin11-llvm-gcc-4.2: no input files
  </code></pre>
  
  <p>I tried <code>export CC=gcc-4.2</code> before running <code>pip install twisted</code>, and I got:</p>
  
  <pre><code>llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
  
  lipo: can't figure out the architecture type of: /var/folders/s8/d0f65gc93nbchdk52g2cg5f80000gn/T//ccWQa7cJ.out
  
  error: command 'gcc-4.2' failed with exit status 255
  </code></pre>
  
  <p>It sort of looks to me like it's looking for <code>powerpc-apple-darwin11-llvm-gcc-4.2</code>, and what I have above is <code>i686-apple-darwin11-llvm-gcc-4.2</code>--are these different and therefore causing the problem?</p>
  
  <p>To give more background info, I installed Python 2.7 from a Python.org installer a long time ago before upgrading from Snow Leopard straight to Mountain Lion.  If I simply type in <code>python</code> at the command line I get</p>
  
  <pre><code>Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:32:06) 
  [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
  </code></pre>
  
  <p>So I'm guessing that means I'm using Apple's Python?  And it's built with gcc-4.0.1?  So if that's the case, shouldn't I not need to do the <code>export CC=gcc-4.2</code>?  Or do I need to do that AND switch to the Python.org version of Python?  (And if the latter, how do I do that?)  </p>
  
  <p><strong>Update:</strong>  I tried <a href="https://superuser.com/a/35288/165175">this solution</a> for switching Python versions but it didn't work.</p>
  
  <p><strong>Update:</strong>  I managed to switch Python versions (outside of my virtualenv) using the <code>sudo port select --set python python27</code> command, but this didn't solve the problem even though I'm now showing:</p>
  
  <pre><code>Python 2.7.3 (default, Nov 17 2012, 19:54:34) 
  [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
  </code></pre>
  
  <p>when I type <code>python</code> at the commmand line.</p>
  
  <p><strong>Update</strong>: I also found <a href="https://stackoverflow.com/a/11796279/1256700">this solution</a> to a question that seemed to have almost the exact same issues as I'm having, but I'm already upgraded to XCode 4.6 and definitely have the Command Line Tools installed as described in the aforementioned solution (Preferences>Downloads tab>Install Command Line Tools).  I do also have XCode 3.2.6 installed, however--any chance that's causing my problems?</p>