Struggling to get started on Windows

Hi! I want to try Swift on Windows using VSCode. I downloaded the package Swift.Toolchain from winget and got version 6.2.3.

Next I installed the Swift extension in VSCode. I created an example executable project (it prints out Hello World)

Now, I can build this in VSCode but when I launch it, either in Release or Debug mode I don’t see any output. From a command line I can see the output when I do swift run. However swift repl gives an error (see below). It seems to be looking for python 3.9 but the winget installer installed 3.10 as far as I can see.

Any ideas how to get started?

> swift repl
error: unable to find 'python39.dll'.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: C:\\Users\\peter\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.2.3+Asserts\\usr\\bin\\lldb.exe "--repl=-disable-objc-interop -sdk C:\\Users\\peter\\AppData\\Local\\Programs\\Swift\\Platforms\\6.2.3\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\ -color-diagnostics -Xcc -fcolor-diagnostics -empty-abi-descriptor -no-auto-bridging-header-chaining -in-process-plugin-server-path C:\\Users\\peter\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.2.3+Asserts\\usr\\bin\\SwiftInProcPluginServer.dll -plugin-path C:\\Users\\peter\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.2.3+Asserts\\usr\\bin -plugin-path C:\\Users\\peter\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.2.3+Asserts\\usr\\local\\bin -autolink-library oldnames -autolink-library msvcrt -Xcc -D_MT -Xcc -D_DLL"
Exception Code: 0xC06D007E
#0 0x00007ff98e3fa80a (C:\WINDOWS\System32\KERNELBASE.dll+0xca80a)
#1 0x00007ff67c58493f (C:\Users\peter\AppData\Local\Programs\Swift\Toolchains\6.2.3+Asserts\usr\bin\lldb.exe+0x3493f)
#2 0x00007ff67c583d58 (C:\Users\peter\AppData\Local\Programs\Swift\Toolchains\6.2.3+Asserts\usr\bin\lldb.exe+0x33d58)
#3 0x00007ff67c559041 (C:\Users\peter\AppData\Local\Programs\Swift\Toolchains\6.2.3+Asserts\usr\bin\lldb.exe+0x9041)
#4 0x00007ff67c585550 (C:\Users\peter\AppData\Local\Programs\Swift\Toolchains\6.2.3+Asserts\usr\bin\lldb.exe+0x35550)
#5 0x00007ff98f1fe8d7 (C:\WINDOWS\System32\KERNEL32.DLL+0x2e8d7)
#6 0x00007ff990dac53c (C:\WINDOWS\SYSTEM32\ntdll.dll+0x8c53c)

output from winget show:

> winget show swift.toolchain
Found Swift [Swift.Toolchain]
Version: 6.2.3
Publisher: swift.org
Author: Swift Open Source Project
Moniker: swift
Description: Swift Toolchain for Windows
Homepage: https://www.swift.org/
License: Apache-2.0
Copyright: Copyright (c) Swift Open Source Project
Tags:
  swift
Installer:
  Installer Type: burn
  Installer Locale: en-US
  Installer Url: https://download.swift.org/swift-6.2.3-release/windows10/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE-windows10.exe
  Installer SHA256: 10a4d887c383bec128f3f11b8caaae8fbd0d13ff10cc9844c578b6560f1f3e77
  Release Date: 2025-09-15
  Offline Distribution Supported: true
  Dependencies:
    - Package Dependencies:
        Git.Git
        Microsoft.VCRedist.2015+.x64 [>= 14.28.29913.0]
        Python.Python.3.10

You may want to try the Swift toolchain builds provided by the Browser Company: Releases · thebrowsercompany/swift-build · GitHub

I’ve successfully been using these for over a year now.

The fact that you don’t see debug output is probably related to the Python version mismatch – the debug session probably doesn’t start at all (lldb needs the correct Python version to work). Not sure what’s the root cause there, though.

Thanks!

I can confirm that manually installing Python.Python.3.9 via winget doesn’t help; presumably because it doesn’t put anything on the path.

For reference/comparison, here’s my PYTHON_HOME

and PATH environment variable settings:

1 Like

Hi Peter,

Did you check the “Debug Console” in Visual Studio Code? The output should appear there (not in the integrated terminal).

Regarding the REPL: I wouldn’t bother with that. I’ve wanted to use it myself for teaching purposes, but it has never worked reliably (or even at all).

1 Like

Thank you both. It was useful to see the paths. I know I am contradicting myself but I have got it working now by using winget to install Python 3.9. What I did was

  • Do winget install Swift.Toolchain Python.Python.3.9
  • Close all terminal windows
  • Open a new terminal window
  • Try swift repl

I suppose the path changes (path to python39.dll) was not being picked up, although I thought I had closed all terminals.

Hope this helps anyone else in the same situation.

In terms of reporting a bug - I think this is with the Swift project itself as winget just points to the swift.org installer. I will investigate.

Note that restarting the terminals is required - but that has nothing to do with the installer, that is how the terminal works on Windows.

I do know that - my mistake, I thought I had done it.

However, there is still a bug, do you agree? Either the installer should not include a version of lldb that needs Python 3.9 (I think this is being discussed here) or, on the winget side, their manifest should have Python.Python.3.9 as a dependency, not Python.Python.3.10.

There are two separate issues. There was an issue in one of the releases being built against python 3.9. That is too late to repair, but future releases should restore the python version to 3.10.

The winget manifest should mirror the dependencies correctly is the second issue. You should be able to raise a PR against the Microsoft repository to correct that.

1 Like