Blender ImportError: cannot import name
Question: I am really almost giving up on trying to create an import-export module addon
to Blender 2.68 and it seems that it is an insurmountable python problem
(Blender uses python 3.3). I see plenty of questions in stackoverflow on this
topic but none of them answers my problem. Part of my script:

    
    
    if "bpy" in locals():
        import imp
        imp.reload(xplane_ui)
        print ("xplane_ui reloaded.")
        imp.reload(explane_import)
        print ("All modules reloaded.")
    
    else:
        import bpy
        from io_explane import xplane_ui
        print ("xplane_ui imported.")
        from io_explane import explane_import #this is line 47
        print ("All modules imported")
    

I added extra print lines to see what is happening. Here is the trace result:

    
    
    Read new prefs: C:\Users\BT\AppData\Roaming\Blender Foundation\Blender\2.68\config\userpref.blend
    found bundled python: C:\blender-2.68a-windows32\2.68\python
    xplane_ui imported
    All modules imported
    xplane_ui imported.
    Traceback (most recent call last):
      File "C:\blender-2.68a-windows32\2.68\scripts\modules\addon_utils.py", line 294, in enable
        mod = __import__(module_name)
      File "C:\blender-2.68a-windows32\2.68\scripts\addons\io_explane\__init__.py", line 47, in <module>
        from io_explane import explane_import
    ImportError: cannot import name explane_import
    

This is so queer. I presume python progresses from top to bottom but how would
it progress through lines 46, 47 and 48 and then change decision on line 47
and announce it could not do it after having obviously done it? Either python
is a useless programmng language or blender is broken or both. Either way the
error trapping routines are extremely unhelpful.


Answer: I don't know Blender, but could it be that you should import `xplane_import`?

