2

I see two diffrent behaviours about .pth and ._pth files:

  • the official Python install for Windows uses .pth files in lib\site-packages as documented in https://docs.python.org/3.12/library/site.html#module-site. It seems that adding multiple .pth files works and is used at the Python interpreter startup.

  • the Python Embedded package for Windows seems to use ._pth files (and not .pth!) for the same thing: python38._pth, but in the same folder as python.exe. In this case it seems that adding a second .pth or ._pth file in the same folder isn't used by the interpreter. Why? Is it documented that, for embedded Python, only one ._pth will be used?

More generally, what are the rules about .pth vs ._pth files? In which case should we use one or the other, what is the reason for the underscore _pth?

Note: the rules seem here complicated (.pth vs ._pth ; multiple files allowed vs. only one file used).

NB: Documentation about ._pth files

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.