Skip to content

Windows embeddable distribution outputs WARN: Could not find the platform standard library directory! #155254

Description

@adang1345

Bug report

Bug description:

When the Windows embeddable distribution version 3.15.0rc1 is extracted and python.exe is run, a warning is shown.

WARN: Could not find the platform standard library directory! The Python 'home' directory was set to 'C:\\Users\\User\\Downloads\\python-3.15.0rc1-embed-amd64', is this correct?
Python 3.15.0rc1 (tags/v3.15.0rc1:37e98da, Aug  4 2026, 11:37:18) [MSC v.1951 64 bit (AMD64)] on win32
>>>

The warning first appears in 3.15.0a7. It is not present in 3.15.0a6 or 3.14.7. #145273 looks suspicious.

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Linked PRs

Activity

  1. picnixz commented on Aug 5, 2026

    @picnixz
    Member
  2. StanFromIreland commented on Aug 5, 2026

    @StanFromIreland
    Member

    I think it's a duplicate of #148750, based on Steve's comment there, but Windows things are scary so I'll leave this to someone else. ;-)

  3. added
    pendingThe issue will be closed if no feedback is provided
    on Aug 5, 2026
  4. zooba commented on Aug 11, 2026

    @zooba
    Member

    Yes, I think it's the same issue, and it's critical now because it's going to block PyManager updates (I expect python/pymanager#397 will fail in CI, as it's failing locally for me).

    Still don't have time to look into it (I'm meant to be AFK and recovering right now), but will prioritise and block releases on this once I'm back online properly.

  5. zooba commented on Aug 17, 2026

    @zooba
    Member

    @chris-eibl found that this issue pre-dates #148750, so we should solve both, but they're likely independent.

  6. reopened this on Aug 17, 2026
  7. self-assigned this
    on Aug 18, 2026
  8. zooba commented on Aug 18, 2026

    @zooba
    Member

    Tagging this as a release blocker as well, since new extra/unnecessary output can be a major regression for users. But the fix (just disable the warning when the user has configured paths themselves) should be safe enough.

  9. chris-eibl commented on Aug 18, 2026

    @chris-eibl
    Member

    Debugging using

    # warn(message) -- print a warning (if enabled)

    shows that

    cpython/Modules/getpath.py

    Lines 777 to 779 in c5168ea

    elif not platstdlib_dir or not isdir(platstdlib_dir):
    hint = home_hint if home else f'sys.exec_prefix is set to {exec_prefix}, is this correct?'
    warn('WARN: Could not find the platform standard library directory! ' + hint)

    fires because platstdlib_dir="<embedded-dir>\DLLs", which does not exist in the embedded case. IIUC, it is set here

    cpython/Modules/getpath.py

    Lines 740 to 741 in c5168ea

    if not platstdlib_dir and base_exec_prefix:
    platstdlib_dir = joinpath(base_exec_prefix, PLATSTDLIB_LANDMARK)

    where
    PLATSTDLIB_LANDMARK = f'{platlibdir}'

    and sys.platlibdir="DLLs". This has been the case for ages, but I wonder whether this should be an empty string in the embedded case?

  10. zooba commented on Aug 18, 2026

    @zooba
    Member

    The problem is that there's no "embedded case" - we only have one build, and the adaptation is dynamic.

    Suppressing the warning when a ._pth file is used matches the same suppression when Py_SetPath or similar have been used, I think it was just missed.

  11. added a commit that references this issue on Aug 21, 2026
  12. added a commit that references this issue on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions