title: ModuleNotFoundError: What does it mean __main__ is not a package?
body: <p>I am trying to run a module from the console. The structure of my directory is this:</p>
  
  <p><a href="https://i.stack.imgur.com/naRKa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/naRKa.png" alt="enter image description here"></a></p>
  
  <p>I am trying to run the module <code>p_03_using_bisection_search.py</code>, from the <code>problem_set_02</code> directory using:</p>
  
  <pre><code>$ python3 p_03_using_bisection_search.py
  </code></pre>
  
  <p>The code inside <code>p_03_using_bisection_search.py</code>is:</p>
  
  <pre><code>__author__ = 'm'
  
  
  from .p_02_paying_debt_off_in_a_year import compute_balance_after
  
  
  def compute_bounds(balance: float,
                     annual_interest_rate: float) -&gt; (float, float):
  
      # there is code here, but I have omitted it to save space
      pass
  
  
  def compute_lowest_payment(balance: float,
                             annual_interest_rate: float) -&gt; float:
  
      # there is code here, but I have omitted it to save space
      pass    
  
  def main():
      balance = eval(input('Enter the initial balance: '))
      annual_interest_rate = eval(input('Enter the annual interest rate: '))
  
      lowest_payment = compute_lowest_payment(balance, annual_interest_rate)
      print('Lowest Payment: ' + str(lowest_payment))
  
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I am importing a function that is in <code>p_02_paying_debt_off_in_a_year.py</code> which code is:</p>
  
  <pre><code>__author__ = 'm'
  
  
  def compute_balance(balance: float,
                      fixed_payment: float,
                      annual_interest_rate: float) -&gt; float:
  
      # this is code that has been omitted
      pass
  
  
  def compute_balance_after(balance: float,
                            fixed_payment: float,
                            annual_interest_rate: float,
                            months: int=12) -&gt; float:
  
      # Omitted code
      pass
  
  
  def compute_fixed_monthly_payment(balance: float,
                                    annual_interest_rate: float) -&gt; float:
  
      # omitted code
      pass
  
  
  def main():
      balance = eval(input('Enter the initial balance: '))
      annual_interest_rate = eval(
          input('Enter the annual interest rate as a decimal: '))
      lowest_payment = compute_fixed_monthly_payment(balance,
                                                     annual_interest_rate)
      print('Lowest Payment: ' + str(lowest_payment))
  
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>ModuleNotFoundError: No module named '__main__.p_02_paying_debt_off_in_a_year'; '__main__' is not a package
  </code></pre>
  
  <p>I have no idea how to solve this issue. I have tried adding a <code>__init__.py</code> file, but it is still not working.</p>