title: Python -- PythonPath
body: <p>I have created a folder in my home directory in ubuntu 12.04 and stord all the python files there.
  I have added path to my directory to pythonpath variable also.
  But it is not working.
  Earlier files were executed when they were in home directory but now they also do not get executed.</p>
  
  <p>In Ubuntu Terminal
      manish@manish-laptop:~$ echo $PYTHONPATH
      /home/manish/project:</p>
  
  <pre><code>manish@manish-laptop:~$ ls -l /home/manish/project
  total 24
  -rw-rw-r-- 1 manish manish  140 May 31 00:07 Connection.py
  -rw-rw-r-- 1 manish manish  122 May 29 11:29 Connection.py~
  -rw-rw-r-- 1 manish manish 7150 May 31 00:07 Host.py
  -rw-rw-r-- 1 manish manish 7132 May 30 23:30 Host.py~
  </code></pre>
  
  <p>`</p>
  
  <p>Execution From Terminal:</p>
  
  <pre><code>&gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.path
  ['', '/home/manish/project', '/home/manish', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/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/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
  </code></pre>
  
  <p>Execution from IDLE :</p>
  
  <pre><code>&gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.path
  ['/usr/bin', '/home/manish/project', '/home/manish', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/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/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
  </code></pre>
  
  <p>In Ubuntu Terminal:</p>
  
  <pre><code>&gt;&gt;&gt; import Host
  &gt;&gt;&gt; obj = Host()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: 'module' object is not callable
  </code></pre>
  
  <p>And Host is python file containing functions and I want to run some of the functions in the host file, that is why I am trying to create a object.It contains one class and class name is same as file name.</p>
  
  <p>I have also granted execute permission on files using chmod command.</p>
  
  <p>File do execute if I change the path to folder 'project' using cd command.
  Here is what i do</p>
  
  <pre><code>  manish@manish-laptop:~$ cd project
    manish@manish-laptop:~/project$ python
    Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    &gt;&gt;&gt; execfile('Host.py')
    &gt;&gt;&gt; obj = Host()
    &gt;&gt;&gt; 
  </code></pre>