Import Error on using pydoc
When you get the import error from Pydoc, there are some steps you can find out the bug.
Step

Check the Python version of your files/packages and Pydoc are mapping. Some environment exist Python2 and Python3 at the same time. Basically, the alias pydoc is for Python 2, and pydoc3.X is for Python 3.
Check the import file exists. Sometime you just import nonexistent file/module.
Check the file/module can be imported by python. If you are documentizing your custom module in Python 2, please check __init__.py exist in your every directory of the main source code.
I have following files in same folder:
config.py, init.py, asc.py and mainfile.py
contents of init.py file:
from mainfile import *
config and asc files are imported in mainfile.py.
I am creating html using pydoc as:
  python -m pydoc -w mainfile.py
I am getting error as:
    <type 'exceptions.ImportError'>: No module named config
If i will remove config, it works fine and html gets created but does not work with config file.
What is the problem?