On Tue, Sep 17, 2024 at 11:01:00AM +0930, Christian Gelinek wrote: > We're using a library of our own Python modules & packages. > > The Python documentation[0] states that the search path can be extended via > <name>.pth files which should be added to specific directories. While the > documentation specifically mentions "lib/pythonX.Y/site-packages (on Unix > and macOS)", I found that Debian seems to do this differently: > > $ python -c 'import site ; print(site.getsitepackages())' > ['/usr/local/lib/python3.11/dist-packages', > '/usr/lib/python3/dist-packages', '/usr/lib/python3.11/dist-packages'] > > I.e. instead of `site-packages`, it uses `dist-packages` sub-folders. > > Given that these sub-folders are managed by Debian/`apt`, where should I > place our custom.pth file pointing to other (network drive) folders we would > like to include in Python's search paths?
I think /usr/local is the one for you: the Debian package manager shouldn't touch it. It's at the front to allow you to override the distro's choices. This is actually a standard pattern in GNU flavoured Unix-ish environments. Cheers -- t
signature.asc
Description: PGP signature