title: "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" in virtualenv
body: <p>Environment: Linux Mint 17 Cinnamon.  </p>
  
  <p>This error is displayed:</p>
  
  <pre><code>error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  </code></pre>
  
  <p>when attempting the following in a <code>virtualenv</code>:</p>
  
  <pre><code>pip install lxml
  pip install pillow
  pip install pycrypto
  pip install pymongo (fails but still shows in pip freeze)
  </code></pre>
  
  <p>There are several solutions here that recommend installing <code>python2.7-dev</code>:</p>
  
  <p><a href="https://stackoverflow.com/questions/25675977/installing-pillow-error-setup-script-exited-with-error-command-x86-64-linux-g">Installing Pillow error: Setup script exited with error: command &#39;x86_64-linux-gnu-gcc&#39; failed with exit status 1</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22239816/installing-lxml-in-virtualenv-via-pip-install-error-command-x86-64-linux-gnu-g">Installing lxml in virtualenv via pip install error: command &#39;x86_64-linux-gnu-gcc&#39; failed</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22347489/pillow-installation-error-command-gcc-failed-with-exit-status-1">Pillow installation error: command &#39;gcc&#39; failed with exit status 1</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory">fatal error: Python.h: No such file or directory</a></p>
  
  <p>I am confused by this recommendation however because it is my understanding that using something like:</p>
  
  <pre><code>sudo apt-get install python2.7-dev
  </code></pre>
  
  <p>would add this to the main *system* instance of Python, rather that the one in <code>virtualenv</code>.  (see - <a href="https://unix.stackexchange.com/a/56392/92486">https://unix.stackexchange.com/a/56392/92486</a>)</p>
  
  <p>Can I add <code>python2.7-dev</code> just to the <code>virtualenv</code> version of Python?  </p>