Python: package root, root-node, in the package root

Veek M vek.m1234 at
Thu Nov 13 08:03:27 CET 2014

I have a package structured like so on the file system:
PKG LIBS are stored here: /usr/lib/python3.2/
Pkg-name: foo-1.0.0

1. What is the root directory, or root-node or 'root' of my package? My 
understanding is that it's: /usr/lib/python3.2/foo-1.0.0/ on the file-system 
and this is referred to the root of the pkg.

2. Can, foo-1.0.0 contain or do i have to do:
foo-1.0.0/foo/ ?

Take a look at what this guy is saying on his blog:

(bottom of the page)
"Your project root should contain a python package, not be a package itself. 
If you do this, your will be very confusing (or not work at all) 
and it will be very difficult to run your code."

(top of the page)

3. Could someone elucidate, explain what it is he's talking about?
Don?t directly run modules inside packages

"What I mean specifically is doing python passacre/, or python 
passacre/test/, or anything else that starts with python 
passacre/. This will prevent python from knowing where the root of your 
package is, and so absolute imports and explicit relative imports will fail, 
or not import the code you think it should be importing."

4. In this particular case, how does the interpreter determine pkg-root?

More information about the Python-list mailing list