title: How to import a python file from another folder in Python 3.5 on OSX?
body: <p>I use Python 3.5 and my project structure is like this: </p>
  
  <pre><code>Project/
      App/
          myApp.py
      Libraries/
          myLibA.py
          myLibB.py
  </code></pre>
  
  <p>I want to import <code>myLibA.py</code> in <code>myApp.py</code></p>
  
  <p>If I simply write <code>from Libraries import myLibA</code> I end up with this error : </p>
  
  <blockquote>
    <p>ImportError: No module named Libraries.</p>
  </blockquote>
  
  <p>I found the Q/A <a href="https://stackoverflow.com/questions/4383571/importing-files-from-different-folder-in-python">Importing files from different folder in Python</a>, from which I adapted my own solution, adding this at the beginning of <code>myApp.py</code> in order to add my <code>Project</code> folder to the Python Path :</p>
  
  <pre><code>import sys
  sys.path.insert(0, sys.path[0] + "..")
  </code></pre>
  
  <p>This worked well on Windows, but when I run <code>myApp.py</code> from the same project on OSX (10.9) I see the same error message, my module is not found. </p>
  
  <p>To reproduce my issue it's very simple. Just fill the Python files like this : </p>
  
  <p><strong>myApp.py</strong> : </p>
  
  <pre><code>import sys
  sys.path.insert(0, sys.path[0] + "..")
  
  from Libraries import myLibA
  
  if __name__ == '__main__':
      myLibA.print_hello()
  </code></pre>
  
  <p><strong>myLibA.py</strong> : </p>
  
  <pre><code>def print_hello():
      print("Hello")
  </code></pre>
  
  <p>I don't understand why the Python Path method doesn't work here. Anyway, I'm looking for a solution that keeps the Python file compatible with Windows and that is contained in the sources (in the Python files). I've seen a few console hooks but I'm not satisfied with that because I want to be able to clone the project on any OSX/Windows PC with Python 3.5, and just run myApp.py. I'm looking for a solution that doesn't involve any library not natively present in Python 3.5. </p>
  
  <p>Is there another way to achieve this ? </p>
  
  <p>(If not, is it because it is somehow not <em>pythonic</em> to organize a project like this? As a C developer I might have the wrong approach)</p>