title: openshift Paas deployment with bottle and python - doesn't find the right place to import from installed modules
body: <p>I'm trying to deploy a small python bottle application to REdHat openshift platform and I keep getting 500 server error. when I ssh into the app and run python I find out that importing bottle (or every other library I use) fails with importError. </p>
  
  <p>I installed the needed modules in two ways (following a couple of tutorials):</p>
  
  <p>both in the setup.py :</p>
  
  <pre><code>install_requires=['sqlalchemy','bottle','requests']
  </code></pre>
  
  <p>and by installing a virtenv in the data folder, activating it with:</p>
  
  <pre><code>source virtenv/bin/activate
  </code></pre>
  
  <p>and pip install bottle sqlalchemy requests</p>
  
  <p>and then editing the wsgi handler entry point :'application'
  to something like:</p>
  
  <pre><code>import os
  here = os.path.dirname(os.path.abspath(__file__))
  os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'data', 'virtenv/lib/python2.7/site-packages')
  
  virtualenv = os.path.join(here, '..', 'data/virtenv/bin/activate_this.py')
  execfile(virtualenv, dict(__file__=virtualenv))
  
  from myappname import application
  </code></pre>
  
  <p>(where myappname contains the actuall bottle application logic)
  after every change pushing everything with git push to openshift
  and then the same 500 server error. when ssh to the app and running</p>
  
  <pre><code>python application
  </code></pre>
  
  <p>I get the import error
  nothing seems to work, I'll be glad to any help here</p>
  
  <p><strong>edit:</strong>
   when ssh into the app and manually doing </p>
  
  <pre><code>source virtenv/bin/activate
  </code></pre>
  
  <p>and trying to run python everything works (well at least most of it works) as expected.
  so for some reason It seems that activate_this.py doesn't behave as expected
  any clues?</p>