title: pdoc3 ValueError: File or module 'xxx' not found if imported from other package
body: <p>pdoc3 is a nice tool to generate documentation from code. In one of my projects, I got some exception. Wonder if it is caused by project structure. These are the folder structure of my two projects.</p>
  
  <pre><code>proj_A
    -src
      -automation
        -hl7ctl
          (has a definition of HL7CtlClient)
  
  proj_B
    -src
      -automation
        -connctl
          -core.py
          -utility.py (uses HL7CtlClient)
  </code></pre>
  
  <p>In the utility.py of the proj_B, I have to import a class from project_A</p>
  
  <pre><code>from automation.hl7ctl import HL7CtlClient
  </code></pre>
  
  <p>This causes the following error by running pdoc3 at src folder in proj_B. The proj_A has been installed by using 'sudo pip3 install proje_A.gz'</p>
  
  <p>automation.connctl.core No module named 'automation.hl7ctl' in pdoc3's code:</p>
  
  <p>(See <a href="https://github.com/pdoc3/pdoc/blob/master/pdoc/__init__.py#L519" rel="nofollow noreferrer">https://github.com/pdoc3/pdoc/blob/master/pdoc/<strong>init</strong>.py#L519</a>)</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/local/bin/pdoc3", line 11, in &lt;module&gt;
      load_entry_point('pdoc3==0.5.5.dev13+g43f28dd.d20190427', 'console_scripts', 'pdoc3')()
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/cli.py", line 419, in main
      for module in args.modules]
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/cli.py", line 419, in &lt;listcomp&gt;
      for module in args.modules]
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/__init__.py", line 943, in __init__
      m, docfilter=docfilter, supermodule=self, context=self._context)
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/__init__.py", line 943, in __init__
      m, docfilter=docfilter, supermodule=self, context=self._context)
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/__init__.py", line 940, in __init__
      m = import_module(fullname)
    File "/usr/local/lib/python3.6/dist-packages/pdoc3-0.5.5.dev13+g43f28dd.d20190427-py3.6.egg/pdoc/__init__.py", line 520, in import_module
      raise ValueError('File or module {!r} not found'.format(module))
  ValueError: File or module 'automation.connctl.core' not found
  </code></pre>
  
  <p>This is how I run pdoc3:</p>
  
  <pre><code>cd src
  pdoc3 --overwrite --html --html-dir ../docs/APIs --template-dir ../docs/templates automation
  </code></pre>
  
  <p>There are <code>__init__.py</code> in automation and its subfolders but not 'src'.</p>
  
  <p>The automation/<code>__init__.py</code> has the following content:</p>
  
  <pre><code>__import__("pkg_resources").declare_namespace(__name__)
  </code></pre>