title: Difference between importing module in Python 3.4 and Python 2.7
body: <p>I am trying to import a package present in another folder and it is working perfectly fine in python 3.4. For Example: the files are present in libraries folder</p>
  
  <pre><code>user&gt; python
  Python 3.4.1 (default, Nov 12 2014, 13:34:29)
  [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from libraries.controller_utils import *
  &gt;&gt;&gt;      
  </code></pre>
  
  <p>However when I open a new shell and use Python 2.7:</p>
  
  <pre><code>user&gt; python
  Python 2.7.4 (default, Jun  1 2015, 10:35:58)
  [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from libraries.controller_utils import *
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named libraries.controller_utils
  &gt;&gt;&gt;
  </code></pre>
  
  <p>I tried adding the entry to <code>sys.path</code> but it is not helping. I read a similar question <a href="https://stackoverflow.com/questions/30249119/difference-in-package-importing-between-python-2-7-and-3-4">here</a> but the solution is not helping me either as I tried both relative and absolute imports. Please advice.</p>
  
  <p>EDIT: The directory structure being <code>~/tests/libraries/controller_utils.py</code>. I am executing these commands inside the tests directory.</p>
  
  <p>EDIT: I have added the sys.path entry as follows but it still does not recognize it. Please note that the error occurs on 2.7 but works absolutely fine on 3.4</p>
  
  <pre><code>user&gt; cd ~/tests/
  user&gt; ls
  __pycache__  backups  inputs  libraries  openflow.py  test_flow.py
  user&gt; ls libraries/
  __pycache__  controller_utils.py  general_utils.py  general_utils.pyc  tc_name_list.py  test_case_utils.py
  user&gt; python
  Python 2.7.4 (default, Jun  1 2015, 10:35:58)
  [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from libraries.controller_utils import *
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named libraries.controller_utils
  &gt;&gt;&gt; import sys
  &gt;&gt;&gt; sys.path.append('libraries/')
  &gt;&gt;&gt; from libraries.controller_utils import *
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named libraries.controller_utils
  </code></pre>