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?

Thanks for your time.

[0]: https://docs.python.org/3/library/site.html

Reply via email to