[issue44673] Embedded Python - local directories in pythonXX._pth

Steve Dower report at bugs.python.org
Wed Jan 19 19:23:34 EST 2022


Steve Dower <steve.dower at python.org> added the comment:

I'm afraid not. The ._pth file is intended for embedding applications that have a static set of search paths.

You may want to try adding a startup file (search for PYTHONSTARTUP) that modifies sys.path directly. Or alternatively if you rename the ._pth file to a regular .pth file, it should disable the isolation protection and use the more flexible algorithm, which *I believe* will resolve relative paths against the current directory rather than where the file lives.

----------
nosy: +steve.dower

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44673>
_______________________________________


More information about the Python-bugs-list mailing list