confused with so many python package locations for imports

Chris Rebert clp2 at
Sat Apr 25 23:34:33 CEST 2009

On Sat, Apr 25, 2009 at 1:31 AM, Ben Finney <ben+python at> wrote:
> Krishnakant <hackingkk at> writes:
>> My Basic question is that, what package directory is Standard as far
>> as all gnu/linux distros are concerned?
> Python has a habit of generating, and expecting to find,
> platform-specific files (‘foo.pyo’ extension modules)

Erm, .pyo-s aren't platform-specific. According to

When the Python interpreter is invoked with the -O flag, optimized
code is generated and stored in .pyo files. The optimizer currently
doesn’t help much; it only removes assert statements.

Passing two -O flags to the Python interpreter (-OO) will cause the
bytecode compiler to perform optimizations that could in some rare
cases result in malfunctioning programs. Currently only __doc__
strings are removed from the bytecode, resulting in more compact .pyo

A program doesn’t run any faster when it is read from a .pyc or .pyo
file than when it is read from a .py file; the only thing that’s
faster about .pyc or .pyo files is the speed with which they are

It's not like .pyo-s are compiled C extension modules.

I have a blog:

More information about the Python-list mailing list