Skip to content

On Windows 10, lldb gets error regarding module encodings #58447

Closed as not planned
@KimTheLearner

Description

@KimTheLearner

This is due to a "bug" in the Swift installation procedure for Windows 10. Below, after describing the issue, I have a solution. I am new at Swift, and other thoughts are welcome!

Environment

build number: Swift 5.6.1
OS: Windows 10 desktop computer

Issue Description

On Windows 10, lldb gets error: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding. error: ModuleNotFoundError: No module named 'encodings'

Test Case

After an install of Swift on Windows 10, run 'lldb Factorial' as shown on Swift - Getting Started > Using the LLDB Debugger. That elicits the error above.

Cause

The env var PYTHONPATH is missing the Python directory: (your-Python-root)\Lib.

Solution

See notes on PYTHONPATH in #58438.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.clonedResolution: Was resubmitted in the appropriate repository rather than transferreddocumentationinaccurate infoBug → documentation: Inaccurate info† websiteArchive • This issue was supposed to belong in the swift-org-website repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions