changing sys.path

Peter Otten __peter__ at
Fri Feb 10 11:00:39 EST 2012

Andrea Crotti wrote:

> On 02/10/2012 03:27 PM, Peter Otten wrote:
>> The package a will be either a.c/a/ or a.b/a/ depending on whether
>> a.c/ or a.b/ appears first in sys.path. If it's a.c/a, that does not
>> contain a c submodule or subpackage.
> I would agree if I didn't have this declaration
> __import__('pkg_resources').declare_namespace(__name__)
> in each subdirectory.

Sorry, you didn't mention that in the post I responded to and I didn't 
follow the thread closely.

I found a description for declare_namespace() at

but the text explaining the function is completely unintelligible to me, so 
I cannot contribute anything helpful here :(

More information about the Python-list mailing list