title: python virtualenv ImportError No module named inspect time flask
body: <p>I recently deleted some old development folders off my disk, and now one of my virtualenv projects doesn't work. I noticed the problem when I tried to import flask.</p>
  
  <p>I am using Ubuntu and I was using python2.7 in the virtualenv instead of python2.6 which is the default python.</p>
  
  <p>I will describe how I fixed it, but I was wanting to know if there was a better way.</p>
  
  <p>fyi I use bash in the terminal by default...</p>
  
  <p>download source from <a href="http://www.python.org/download/releases/2.7/" rel="noreferrer">http://www.python.org/download/releases/2.7/</a></p>
  
  <p>move source file into /project/src/dir and extract</p>
  
  <p>change the working directory of the terminal to the newly extracted directory</p>
  
  <p>configure and make</p>
  
  <pre><code>mkdir python2.7
  ./configure --prefix=/project/src/dir/python2.7
  make
  make install
  </code></pre>
  
  <p>create virtualenv and specify python to use</p>
  
  <pre><code>virtualenv --no-site-packages -p /project/src/dir/python2.7/bin/python2.7 projectname
  </code></pre>
  
  <p>enter the virtual environment</p>
  
  <pre><code>cd projectname
  source bin/activate
  </code></pre>
  
  <p>get flask if you want it</p>
  
  <pre><code>pip install flask
  </code></pre>
  
  <p>test to see if we can import time and inspect</p>
  
  <p>(bash)</p>
  
  <pre><code>python
  </code></pre>
  
  <p>(python shell)</p>
  
  <pre><code>import time
  import inspect
  </code></pre>
  
  <p>test to see if we can import flask</p>
  
  <pre><code>import flask
  </code></pre>