title: Sphinx can't find the root module of my project
body: <p>I have this sample project to learn how Sphinx works.</p>
  <p>Directory structure is looking like this:</p>
  <pre><code>.
  +--app
  |  +--api
  |     +--endpoints
  |        +--address.py
  |
  |--docs
  |  +--conf.py
  |  +--index.rst
  |  +--source
  |     +--modules.rst
  |     +--address.rst
  </code></pre>
  <p>I've added the relevant filepaths to my path in <code>conf.py</code>, as follows:</p>
  <pre class="lang-python prettyprint-override"><code>import os
  import sys
  from pathlib import Path
  
  project_root = Path(os.getcwd()).parent.absolute()
  sys.path.insert(0, project_root)
  
  path_app = os.path.join(project_root, &quot;app&quot;)
  sys.path.insert(0, path_app)
  
  path_address = os.path.join(project_root, &quot;app&quot;, &quot;api&quot;, &quot;endpoints&quot;)
  sys.path.insert(0, path_address)
  </code></pre>
  <p>I have my ./docs/index.rst file, autogenerated by Sphinx:</p>
  <pre><code>.. Sky-Payment documentation master file, created by
     sphinx-quickstart on Fri Apr 16 17:23:31 2021.
     You can adapt this file completely to your liking, but it should at least
     contain the root `toctree` directive.
  
  Welcome to Sky-Payment's documentation!
  =======================================
  
  .. toctree::
     :maxdepth: 2
     :caption: Contents:
  
  
  
  Indices and tables
  ==================
  
  * :ref:`genindex`
  * :ref:`modindex`
  * :ref:`search`
  </code></pre>
  <p>Then I have my <code>docs/source/modules.rst</code> file:</p>
  <pre><code>app
  ===
  
  .. toctree::
     :maxdepth: 4
  
     address
  </code></pre>
  <p>and my <code>docs/source/address.rst</code> file:</p>
  <pre><code>address module
  ==============
  
  .. automodule:: app.api.endpoints.address
     :members:
     :undoc-members:
     :show-inheritance:
  </code></pre>
  <p>when I run <code>sphinx-build.exe -b html . .\_build</code> from <code>.\docs</code>, I get this error:</p>
  <pre><code>WARNING: autodoc: failed to import module 'api.endpoints.address' from
  module 'app'; the following exception was raised: No module named
  'app'
  </code></pre>
  <p>What am I doing wrong here?</p>