title: WARNING: autodoc: failed to import module 'OCR'; the following exception was raised: No module named 'OCR'
body: <p>I have Problems to let 'autodoc' read a Python File ( OCR.py ).
  I have no Idea what the Problem could be. Maybe someone can help.
  Thank you a lot for reading and maybe advising!</p>
  
  <pre><code>Folder Structure:
  
  AutoQA
    Docu
      _build
      QALibs
        Automation.rst
      conf.py
      index.rst
      make.bat
    QALibs
      Automation
        Automation.py
        OCR.py
  </code></pre>
  
  <p>If I move the <code>OCR.py</code> File to <code>AutoQA/QAlibs/OCR</code> then it works. But I don't want do that because it belongs to the Automation Folder.</p>
  
  <hr>
  
  <pre><code>Automation.rst:
  
  Automation
  ==========
  
  .. automodule:: Automation
      :members:
      :undoc-members:
      :inherited-members:
  
  .. automodule:: OCR
      :members:
      :undoc-members:
      :inherited-members:
  </code></pre>
  
  <hr>
  
  <pre><code>conf.py:
  
  import sys, os
  sys.path.append(os.path.abspath('../QALibs'))
  
  project = 'AutoQA'
  
  extensions = [
      'sphinx.ext.autodoc'
  ]
  
  html_theme = "sphinx_rtd_theme"
  </code></pre>
  
  <hr>
  
  <pre><code>index.rst:
  
  .. toctree::
      :maxdepth: 4
      :caption: QALibs Documentation
  
      QALibs/Automation
  </code></pre>
  
  <hr>
  
  <pre><code>OCR.py ( Excerpt ):
  
  '''
  Module **OCR** provides Tools for Screen Reading.
  Uses `Tesseract OCR`_.
  
  .. _Tesseract OCR: https://github.com/tesseract-ocr/tesseract
  '''
  import pytesseract, pyautogui, sys, cv2
  sys.path.append('../..')
  from QALibs.Automation import Automation
  from QALibs.Log import Log
  
  
  @staticmethod
  def findText(text, getRightPosition=False):
  ...
  </code></pre>
  
  <p>I also thought it could be because of the <code>sys.path.apend</code> here. But it doesn't make any difference if with this Line or without.</p>
  
  <hr>
  
  <pre><code>Sphinx 'make html' Output after 'make clean':
  
  Removing everything under '_build'...
  Running Sphinx v2.1.2
  making output directory... done
  building [mo]: targets for 0 po files that are out of date
  building [html]: targets for 23 source files that are out of date
  updating environment: 23 added, 0 changed, 0 removed
  reading sources... [100%] py-modindex
  WARNING: autodoc: failed to import module 'OCR'; the following exception was raised:
  No module named 'OCR'
  looking for now-outdated files... none found
  pickling environment... done
  checking consistency... done
  preparing documents... done
  writing output... [100%] py-modindex
  generating indices... genindex py-modindex
  writing additional pages... searchc:\users\dschiller.iet\appdata\local\programs\python\
    python37-32\lib\
    site-packages\sphinx_rtd_theme\search.html:20: RemovedInSphinx30Warning: 
    To modify script_files in the theme is deprecated. Please insert a 
    &lt;script&gt; tag directly in your theme instead.
    {{ super() }}
  
  copying images... [100%] AutoQA\../Images/AutoQA/Initializer.png
  copying static files... done
  copying extra files... done
  dumping search index in English (code: en) ... done
  dumping object inventory... done
  build succeeded, 9 warnings.
  
  The HTML pages are in _build\html.
  </code></pre>