Plugin system, RuntimeWarning: Parent module 'ext_abc' not found while handling absolute import

Torsten Mohr tmohr at s.netic.de
Mon Jan 26 14:06:20 EST 2009


Hello,

>> Basically, this here works but gives a warning:
>> RuntimeWarning: Parent module 'ext_abc' not found while handling
>> absolute import
> 
> 
>> here = os.path.abspath('.')
> 
> (Unrelated to the main question, but you probably want to use
> os.path.dirname(os.path.abspath(__file__)) instead - the above just
> returns the current directory, which might not be the directory containing
> the module)

Thanks, i'll try that.

>> mpath = os.path.abspath('mymodule')
>> epath = os.path.abspath('extension')
>>
>> sys.path.append(here)
>> sys.path.append(mpath)
>>
>> FILE mymodule/__init__.py:
> 
> So mymodule is actually a package. Packages should *not* appear in
> sys.path.

Oh, how does it find modules then?  I thought that would be PYTHONPATH or
sys.path ?


Best regards,
Torsten.




More information about the Python-list mailing list