The sysconfig & site modules cover the addition of non-stdlib directories to sys.path, but be aware that many Linux distros patch that logic to better align with the conventions of that particular distro.

So your discrepancy is likely coming from either build process differences between the Debian & Gentoo packages, or else patches in one distro but not the other have actually altered the behaviour.


On Sun., 4 Oct. 2020, 12:41 am Mikhail Golubev via Python-Dev, <> wrote:
Hi everyone!

First of all, sorry for bringing up, perhaps, a trivial matter, but since it's about the sources I guess it's better to ask it here.

I'm investigating a curious problem caused by the fact that in a user's virtualenv, created with the standard "venv" module, "lib64" directory, traditionally symlinked to "lib", gets included in sys.path
instead of "lib" itself.

$ python -msite

sys.path = [

The user is on Gentoo, and, though the venv's layout is exactly the same, it's different from the typical result on a Debian-based distribution where it's the original "lib" in sys.path, not its "lib64" link. I'm wondering what's controlling this behavior. Modules/getpath.c doesn't mention architecture-dependent lib directories anywhere, at least at first glance. Could someone please give me a hint about where to look in the sources or, maybe, which build options are affecting this?

Thanks a lot!
Python-Dev mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct: