title: Using virtualenv and error message: - setuptools pip wheel failed with error code 1
body: <p>There has been quite a few installations of Python and Anacondas on my Mac over the years, and to some extent these have been neglected and I suspect now resurface and cause me issues. </p>
  
  <p>I'd like to setup a <strong>virtualenv</strong> environment and did a <strong>pip install virtualenv</strong>. I'd like to create a new environement, <strong>Django18</strong>, for Django1.8, but after executing the command <strong>virtualenv Django18</strong> I receive an error message:</p>
  
  <pre><code>OSError: Command ~/Desktop/Django18/bin/python - setuptools pip wheel failed with error code 1
  </code></pre>
  
  <p><strong>bash_profile</strong></p>
  
  <pre><code># added by Anaconda2 4.2.0 installer
  export PATH="~/anaconda2/bin:$PATH"
  </code></pre>
  
  <p><strong>command: which python</strong></p>
  
  <pre><code>~/anaconda2/bin/python
  </code></pre>
  
  <p><strong>In /usr/bin/:</strong></p>
  
  <pre><code>-rwxr-xr-x     2 root   wheel     58416 Jul 15  2015 python
  -rwxr-xr-x     5 root   wheel       925 Sep 10  2014 python-config
  lrwxr-xr-x     1 root   wheel        75 Nov  9  2014 python2.6 -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
  lrwxr-xr-x     1 root   wheel        82 Nov  9  2014 python2.6-config -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
  lrwxr-xr-x     1 root   wheel        75 Nov  9  2014 python2.7 -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  lrwxr-xr-x     1 root   wheel        82 Nov  9  2014 python2.7-config -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
  -rwxr-xr-x     2 root   wheel     58416 Jul 15  2015 pythonw
  lrwxr-xr-x     1 root   wheel        76 Nov  9  2014 pythonw2.6 -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
  lrwxr-xr-x     1 root   wheel        76 Nov  9  2014 pythonw2.7 -&gt; ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
  </code></pre>
  
  <p><strong>.profile</strong></p>
  
  <pre><code>export PATH="/opt/local/lib/gmt4/bin:$PATH"
  export PATH="~/teqc:$PATH"
  export PATH="/usr/local/runpkr000:$PATH"
  export LC_ALL=en_US.UTF-8
  export LANG=en_US.UTF-8
  
  # MacPorts Installer addition on 2015-04-02_at_16:40:23: adding an appropriate PATH variable for use with MacPorts.
  # export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
  # Finished adapting your PATH environment variable for use with MacPorts.
  
  # added by Anaconda 2.3.0 installer
  # export PATH="~/anaconda/bin:$PATH"
  </code></pre>
  
  <p>I suspect there needs to be some clearing up with this, but how can I resolve this error message and get <strong>virtualenv</strong> to work as expected? I have tried several methods already out there, but it's difficult for me to recognise what exactly in my case is causing this issue, before applying a potential remedy.</p>
  
  <hr>
  
  <p><strong>/opt/local/bin (is that macports installation)?:</strong></p>
  
  <pre><code>lrwxr-xr-x    1 root  admin       24 Oct  9  2016 python -&gt; /opt/local/bin/python2.7
  lrwxr-xr-x    1 root  admin       31 Oct  9  2016 python-config -&gt; /opt/local/bin/python2.7-config
  lrwxr-xr-x    1 root  admin       73 Dec 14  2014 python2.7 -&gt; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  lrwxr-xr-x    1 root  admin       80 Dec 14  2014 python2.7-config -&gt; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
  lrwxr-xr-x    1 root  admin       25 Oct  9  2016 pythonw -&gt; /opt/local/bin/pythonw2.7
  lrwxr-xr-x    1 root  admin       74 Dec 14  2014 pythonw2.7 -&gt; /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
  </code></pre>
  
  <p><strong>/usr/Local/bin</strong></p>
  
  <pre><code>lrwxr-xr-x   1 root    staff        69 Dec 12  2012 python3 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3
  lrwxr-xr-x   1 root    staff        72 Dec 12  2012 python3-32 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3-32
  lrwxr-xr-x   1 root    staff        76 Dec 12  2012 python3-config -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3-config
  lrwxr-xr-x   1 root    staff        71 Dec 12  2012 python3.3 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3
  lrwxr-xr-x   1 root    staff        74 Dec 12  2012 python3.3-32 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-32
  lrwxr-xr-x   1 root    staff        78 Dec 12  2012 python3.3-config -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-config
  lrwxr-xr-x   1 root    staff        72 Dec 12  2012 python3.3m -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m
  lrwxr-xr-x   1 root    staff        79 Dec 12  2012 python3.3m-config -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m-config
  lrwxr-xr-x   1 root    staff        70 Dec 12  2012 pythonw3 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3
  lrwxr-xr-x   1 root    staff        73 Dec 12  2012 pythonw3-32 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3-32
  lrwxr-xr-x   1 root    staff        72 Dec 12  2012 pythonw3.3 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3
  lrwxr-xr-x   1 root    staff        75 Dec 12  2012 pythonw3.3-32 -&gt; ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3-32
  </code></pre>
  
  <p><strong>import sys
  sys.path</strong></p>
  
  <pre><code>~/anaconda2/lib/python27.zip
  ~/anaconda2/lib/python2.7
  ~/anaconda2/lib/python2.7/plat-darwin
  ~/anaconda2/lib/python2.7/plat-mac
  ~/anaconda2/lib/python2.7/plat-mac/lib-scriptpackages
  ~/anaconda2/lib/python2.7/lib-tk
  ~/anaconda2/lib/python2.7/lib-old
  ~/anaconda2/lib/python2.7/lib-dynload
  ~/anaconda2/lib/python2.7/site-packages
  ~/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg
  ~/anaconda2/lib/python2.7/site-packages/aeosa
  ~/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg
  </code></pre>
  
  <p><strong>/opt/local/Library/Frameworks:</strong></p>
  
  <pre><code>Python.framework
  </code></pre>
  
  <p><strong>/System/Library/Frameworks</strong></p>
  
  <pre><code>Python.framework
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p><code>which python</code> produces :</p>
  
  <pre><code>~/anaconda2/bin/python
  </code></pre>
  
  <p><code>which -a python</code> produces :</p>
  
  <pre><code>~/anaconda2/bin/python
  /usr/bin/python
  </code></pre>
  
  <p>They're not the same. But then after deleting python installations in: </p>
  
  <pre><code>/opt/local/bin
  /usr/Local/bin
  /usr/bin
  </code></pre>
  
  <p>and using <code>rm -rf python*</code> and <code>sudo rm -rf python*</code> in </p>
  
  <pre><code>/opt/local/Library/Frameworks
  </code></pre>
  
  <p>the <code>which</code> outputs then become the same. </p>
  
  <p>I've realised that the <code>which python</code> command actually refers to what is written in the <code>.bash_profile</code> file and not <code>.profile</code> (priority to .bash_profile). </p>
  
  <p>In any case I commented out the <code>$PATH</code> in my <code>.bash_profile</code>, so forcing the environment variables only to be used in the <code>.profile</code> file. Then <code>source ~/.bash_profile</code>. </p>
  
  <p>In my <code>.profile</code> I added:</p>
  
  <pre><code>export PATH="/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages:$PATH
  </code></pre>
  
  <p>Then <code>source ~/.profile</code></p>
  
  <p>However after <code>which python</code> I still get:</p>
  
  <pre><code>~/anaconda2/bin/python
  </code></pre>
  
  <p>This is getting a bit frustrating as even changing the relevant files and deleting certain python installations, the result is still the same :-/</p>