title: ImportError: No module named main
body: <p>I created a program whose setup.py imports setuptools and includes: </p>
  
  <pre><code>scripts=['scripts/vibez'],
  </code></pre>
  
  <p>The layout of the directories is as follows</p>
  
  <pre><code>projectdirectory
  ├── __init__.py
  ├── main.py
  └── scripts
      └── vibez
  </code></pre>
  
  <p>The vibez script includes:</p>
  
  <pre><code>#!python
  import vibez
  
  vibez.start_vibez()
  </code></pre>
  
  <p>The <code>__init__</code> script includes:</p>
  
  <pre><code>from main import execute
  def start_vibez():
      main()
  </code></pre>
  
  <p>The main.py file is annotated at the bottom with:</p>
  
  <pre><code>if __name__ == '__main__':
      execute()
  </code></pre>
  
  <p>I install my application using <code>python setup.py install.</code></p>
  
  <p>I execute <code>vibez</code> and this successfully runs the <code>__init__</code> file.
  It seems as if the <code>__init__</code> file's import of main can not be found and I get:</p>
  
  <pre><code>  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/vibez", line 4, in &lt;module&gt;
      __import__('pkg_resources').run_script('vibez==0.78', 'vibez')
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 735, in run_script
      self.require(requires)[0].run_script(script_name, ns)
  ImportError: No module named 'main'
  </code></pre>
  
  <p>Why is this occurring?</p>