title: Importing in python packages compared to normal scripts
body: <p>I've written a small python code that parses data from a file and then uses Selenium to input the data into a website, and I am trying to bundle it with a script.</p>
  
  <p>I was already able to bundle it into a pip package and upload it, but when trying to run it I get <code>ImportError: No module named '&lt;name&gt;'</code> for modules on the same directory.</p>
  
  <p>My structure is pretty simply</p>
  
  <pre><code>chessil_tourney_inserter/
      setup.py
      chessil_tourney_inserter/
          __init__.py (empty)
          chessil_tourney_inserter.py
          swiss98_text_parser.py
          command_line.py
  </code></pre>
  
  <p>And the setup.py is also pretty basic:</p>
  
  <pre><code>from setuptools import setup
  
  setup(name='chessil_tourney_inserter',
      .
      .
      .
      packages=['chessil_tourney_inserter'],
      zip_safe=False,
  
      install_requires = [
         'selenium'
      ],
  
      entry_points={
          'console_scripts': [
          'insertchessiltourney = chessil_tourney_inserter.command_line:main']
      })
  </code></pre>
  
  <p>As of right now <code>command_line.main</code> simply calls <code>chessil_tourney_inserter</code>:</p>
  
  <pre><code>import chessil_tourney_inserter.chessil_tourney_inserter as cti
  import sys
  
  def main():
      if len(sys.argv) == 1:
          print("Usage: chessil_tourney_inserter.py *tournament name*")
          exit()
      cti.main();
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>and chessil_tourney_inserter gives me an import error on:</p>
  
  <pre><code>import swiss98_text_parser
  </code></pre>
  
  <p>but if I try to run <code>chessil_tourney_inserter.py</code> directly it works, and if I add the package name to the import it would break <code>chessil_tourney_inserter.py</code></p>
  
  <p>So how am I supposed to set up the files so that imports will work correctly both when I run the file directly myself, and when I try to import it as a package or run it as a script?</p>