Python importing nightmare I'm having the hardest time trying to import a few things. I have an addon that has multiple files all under one folder with an __init__.py in the base. I'm performing all of these imports from this __init__.py. The addon folder resides in my addon folder as scripts/addons/RLD_Toolkit

My directory hierarchy looks like this


The part of the script where it errors

def register():
    #These imports do not work
    from . import rld_panel
    import rld_panel

    #This import does work
    import RLD_Toolkit.rld_panel


The error I'm getting is 

Import Error: cannot import name `rld_panel`


Why won't it perform the relative imports (or even the straight up import) from my __init__.py?

Edit:
Here's a printout of my globals() variables and sys.path
To answer the question, you will have to add the line:

sys.path.append(__path__)


before importing anything. This will add the current folder into the path Python looks in for imports. Then you can import files  with:

import foo


instead of:

from bar import foo


.