Where are python module installed?

John jmg3000 at gmail.com
Mon Sep 21 01:24:54 EDT 2009


On Sep 20, 11:34 pm, Peng Yu <pengyu... at gmail.com> wrote:
>
> The newly compiled python does pick up the newly installed module. How
> does it do so? Is the module path hard coded in the python executable
> when the executable is compiled?
>

Hi Peng,

Yes, the Python that you configured and built knows all about where
*its* modules are kept. So, later, if you run `python setup.py
install` when installing a module you've downloaded from the PyPI, the
`site-packages` directory that gets used is the one belonging to the
`python` that comes first in your `$PATH`. :)

There's a lot of good info in the top-level Python README file
distributed with the source.

After you run `./configure --prefix=/foo/bar/baz`, have a look inside
the generated Makefile (look for `${prefix}`). You might also take a
peek into the config.log file that gets created.

---John



More information about the Python-list mailing list