title: How to import a module from local directory rather than pip-installed library?
body: <p>I have cloned a python library <code>xyz</code> into my computer. The file structure is as follows:</p>
  
  <pre><code>&gt;&gt; project (folder)
      * main.py
      &gt;&gt; xyz_git (folder)
            &gt;&gt; xyz (folder)
  </code></pre>
  
  <p>In the <code>main.py</code></p>
  
  <pre><code>import sys
  sys.path.insert(0, './xyz_git')
  from xyz import Xyz
  
  instance = Xyz()
  print(instance.some_function())
  </code></pre>
  
  <p>The problem is I also have pip-installed module <code>xyz</code> to default python. Even if I remove the local folder, the <code>from xyz import Xyz</code> will still work due to the default pip installation. How can I ensure if the <code>xyz</code> import is not from local directory, it will give an error?</p>