title: Python code runs from IDE, but not from terminal
body: <p>My imports don't work when I try to run the code from Linux terminal. Specifically, imports from other packages in the same project. I know this is a PYTHONPATH issue, but I don't know how to diagnose it further or solve it.
  The code runs fine inside the IDE (eclipse).</p>
  
  <p>I am interested in a permanent solution, guessing it will involve editing .bashrc. I simply want to invoke scripts from command line, like</p>
  
  <pre><code>python my_script.py
  </code></pre>
  
  <p><code>os.environ["PYTHONPATH"]</code> gives a key error in ipython terminal.</p>
  
  <p>I tried</p>
  
  <pre><code>print os.getcwd()
  print sys.path
  </code></pre>
  
  <p>Inside IDE</p>
  
  <pre><code>/home/myname/workspace/project2/main
  
  ['/home/myname/workspace/project2/main', '/home/myname/workspacep/problem2', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_6
  4-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/p
  ython2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pytho
  n2.7/dist-packages/ubuntu-sso-client', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/lib-old']
  </code></pre>
  
  <p>Inside terminal</p>
  
  <pre><code>/home/myname/workspace/project2/main
  
  ['/home/myname/workspace/project2/main', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
  </code></pre>