title: How to import from a sibling directory in python3?
body: <p>I have the following file structure:</p>
  
  <pre><code>bot
  ├── LICENSE.md
  ├── README.md
  ├── bot.py # &lt;-- file that is executed from command line
  ├── plugins
  │   ├── __init__.py
  │   ├── debug.py
  │   └── parsemessages.py
  ├── helpers
  │   ├── __init__.py
  │   ├── parse.py
  │   └── greetings.py
  └── commands
      ├── __init__.py
      └── search.py
  </code></pre>
  
  <p><code>bot.py</code>, when executed from the command line, will load in everything in the <code>plugins</code> directory.</p>
  
  <p>I want <code>plugins/parsemessages.py</code> to import <code>parse</code> from the <code>helpers</code> directory, so I do that:</p>
  
  <pre><code># parsemessages.py
  from ..helpers import parse
  parse.execute("string to be parsed")
  </code></pre>
  
  <p>I run <code>python3 bot.py</code> from the command line.</p>
  
  <p>I get the following error:</p>
  
  <pre><code>File "/home/bot/plugins/parsemessages.py", line 2, in &lt;module&gt;
    from ..helpers import parse
  ValueError: attempted relative import beyond top-level package
  </code></pre>
  
  <p>So I change two dots to one:</p>
  
  <pre><code># parsemessages.py
  from .helpers import parse
  parse.execute("string to be parsed")
  </code></pre>
  
  <p>...but I get another error:</p>
  
  <pre><code>File "/home/bot/plugins/parsemessages.py", line 2, in &lt;module&gt;
    from .helpers import parse
  ImportError: No module named 'plugins.helpers'
  </code></pre>
  
  <p>How can I get this import to work?</p>
  
  <p>It's worth noting that I'm not attempting to make a package here, this is just a normal script. That being said, I'm not willing to mess around with <code>sys.path</code> - I want this to be clean to use.</p>
  
  <p>Additionally, I want <code>parse</code> to be imported as <code>parse</code> - so for the example above, I should be typing <code>parse.execute()</code> and not <code>execute()</code>.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/40022220/attempted-relative-import-beyond-toplevel-package">this post</a> and <a href="https://stackoverflow.com/questions/30669474/beyond-top-level-package-error-in-relative-import">this post</a>, but they start with a file that's quite deep in the file structure (mine is right at the top). I also found <a href="https://stackoverflow.com/questions/6323860/sibling-package-imports/50193944#50193944">this post</a>, but it seems to be talking about a package rather than just a regular .py.</p>
  
  <p>What's the solution here?</p>