title: Python no module named X - absolute imports
body: <p>Before I even start I want to say - I know, that there are like bazillion questions similar to this, but I couldn't find the answer to my problem. I have a dir structure like this:</p>
  <pre><code>.
  ├── project
  │   ├── A
  │   │   ├── __init__.py
  │   │   └── somelib.py
  │   ├── B
  │   ├── C
  │   │   └── C
  │   │       ├── foo.py
  │   │       └── __init__.py
  │   └── __init__.py
  └── run.sh
  </code></pre>
  <p><strong>run.sh</strong>:</p>
  <p><code>python3 project/C/C/foo.py</code></p>
  <p><strong>foo.py</strong>:</p>
  <p><code>from project.A.somelib import somefunc</code></p>
  <hr />
  <p>VS Code actually gets the intellisense in <code>foo.py</code> - it tells me what funcitons/variables I can import from <code>somelib</code>. But when I run <code>run.sh</code>, I get this error message:</p>
  <pre><code>from project.A.somelib import somefunc
  ModuleNotFoundError: No module named 'project'
  </code></pre>
  <p>Is there a way to solve this while preserving this directory structure?</p>
  <hr />
  <ul>
  <li>adding <code>project/__init__.py</code> changed nothing</li>
  <li>the <code>sys.path</code> in <code>foo.py</code> looks like this:</li>
  </ul>
  <pre><code>['/home/dabljues/projects/project/project/C/C', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']
  </code></pre>
  <h3>restrictions:</h3>
  <ul>
  <li>I can't modify neither <code>sys.path</code> in the files nor <code>PYTHONPATH</code> before running the scripts</li>
  <li>I can't pip-install anything</li>
  <li>I don't have sudo-access</li>
  <li>I can't create a virtualenv, since the scripts are supposed to be downloadable and quickly executable</li>
  </ul>