title: How to create a Python 3.5 virtual environment with Python 2.7?
body: <p>My system is running CentOS 6. I do not have admin access, so <code>sudo</code> is not available. I have Python 2.7.3 available, along with <code>pip</code> and <code>virtualenv</code>. I was hoping that I could use these to set up a new virtual environment in which to install &amp; run Python 3.5 or above. </p>
  
  <p>I tried the method described here:
  <a href="https://stackoverflow.com/questions/23842713/using-python-3-in-virtualenv">Using Python 3 in virtualenv</a></p>
  
  <p>But got this error:</p>
  
  <pre><code>$ virtualenv -p python3 venv
  The path python3 (from --python=python3) does not exist
  </code></pre>
  
  <p>My system also has a Python 3.4 module installed, so I tried that, however virtualenv does not seem to work there:</p>
  
  <pre><code>$ module load python/3.4.3
  $ virtualenv -p python3 venv
  -bash: virtualenv: command not found
  </code></pre>
  
  <p>This appears to make sense since <code>virtualenv</code> is only installed for Python 2.7:</p>
  
  <pre><code>$ module unload python
  $ module load python/2.7
  $ which virtualenv
  /local/apps/python/2.7.3/bin/virtualenv
  </code></pre>
  
  <p>So, the next logical step would seem to be installing <code>virtualenv</code> for my Python 3... but this does not work either:</p>
  
  <pre><code>$ pip3 install virtualenv
  Traceback (most recent call last):
    File "/local/apps/python/3.4.3/bin/pip3", line 7, in &lt;module&gt;
      from pip import main
  ImportError: cannot import name 'main'
  </code></pre>
  
  <p>also</p>
  
  <pre><code>$ pip3 install --user virtualenv
  Traceback (most recent call last):
    File "/local/apps/python/3.4.3/bin/pip3", line 7, in &lt;module&gt;
      from pip import main
  ImportError: cannot import name 'main'
  </code></pre>
  
  <p>I started Google'ing this new error message, but did not see anything that seemed relevant for this situation. Any ideas? Even if I could get <code>virtualenv</code> installed on my Python 3.4 module, would I still be unable to upgrade it to Python 3.5+?</p>
  
  <p>To round things out, I also tried to compile my own Python 3.6 from source, but that does not work either:</p>
  
  <pre><code>Python-3.6.0$ make install
  if test "no-framework" = "no-framework" ; then \
          /usr/bin/install -c python /usr/local/bin/python3.6m; \
      else \
          /usr/bin/install -c -s Mac/pythonw /usr/local/bin/python3.6m; \
      fi
  /usr/bin/install: cannot create regular file `/usr/local/bin/python3.6m': Permission denied
  make: *** [altbininstall] Error 1
  </code></pre>
  
  <p>more background info:</p>
  
  <pre><code>$ which pip3
  /local/apps/python/3.4.3/bin/pip3
  
  $ which python
  /local/apps/python/3.4.3/bin/python
  </code></pre>