title: How can I import a file present in different folder in python?
body: <p>I have the following structures: </p>
  
  <ul>
  <li><p>SnapQuick</p>
  
  <ul>
  <li><p>main</p>
  
  <ul>
  <li>snap_view.py</li>
  <li>login.py</li>
  <li>signup.py</li>
  </ul></li>
  <li><p>profile</p>
  
  <ul>
  <li>profile.py</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>profile.py has the following imports</p>
  
  <pre><code>from os import sys
  sys.path.insert(1,'../')
  
  from main import login
  import sqlite3
  
  class profile():
      def show_profile(self,user_id):
          pass(some_code....)
  </code></pre>
  
  <p>login.py has the following imports</p>
  
  <pre><code>import sqlite3
  from os import sys,system
  
  sys.path.insert(1,"../")
  
  import signup
  from profile import profile
  import snap_main
  
  
  class login:
      def login(self):
  </code></pre>
  
  <p>On running profile.py I am getting an error</p>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File "profile.py", line 6, in
    
        from main import login   File "../main/login.py", line 6, in 
        import signup ModuleNotFoundError: No module named 'signup'</p>
  </blockquote>