confused with so many python package locations for imports

David Cournapeau cournape at gmail.com
Sat Apr 25 07:16:09 CEST 2009


On Sat, Apr 25, 2009 at 2:36 AM, Krishnakant <hackingkk at gmail.com> wrote:
>
> hello all,
> I was doing my first complete python packaging for my software and I am
> totally confused.
> I see, /usr/local/lib/python-2.6/site-packages and also dist-packages.
> Then I also see a directory called pyshare, then again site-packages in
> usr/lib/python (I am not even remembering correct paths for many such
> locations ).

Some of those locations are OS specific - pyshare is specific to
debian I think, for example.

>
> Now my question is, which the perfect place?  I would like to know if I
> write a distutils based setup.py for my application, then which is the
> place which I should choose?

I am not sure I understand: your package setup and installation
location are totally independent. Once you finish your package, you
can install it wherever you want, using the --prefix option of the
distutils install command. You should avoid using /usr as an
installation prefix, because it is generally assumed to be owned by
the system. /usr/local is not, though.

David



More information about the Python-list mailing list