When I install swift correctly, according to the website, I get an error code while trying "swift --version" and there is no error code when I do "swift" it just goes to another line.

This is the error code I got:
compnerd.org Swift version 5.3.1 (swift-5.3.1-RELEASE)
Target: x86_64-unknown-windows-msvc

So how I downloaded it was I got the toolchain, it was an exe file, I run it, it completes without error, then I install the required and reccomended components in visual studio. After that I run the commands to copy the files for the windows installation into the visual studio command prompt, then I type in "swift --version" and that error code pops up.

I am using the stable 5.3.1 and I tried using the Trunk Development snapshots and it still did not work.

That is actually the desired output for swift --version on Windows when installed correctly.
What would you have wanted it to output?
swift on the other hand should open the REPL, but to my understanding it requires additional flags to work.

On Windows, Swift REPL requires the latest version of Python 3 installed, and available in the PATH.

Hi @Sourpickle0402

If you want to get started on Windows, you can follow the instructions on https://github.com/pwsacademy/swift-setup/blob/main/platforms/windows/README.md and https://github.com/pwsacademy/swift-setup/blob/main/editors/vscode-windows/README.md

That should help you navigate around the known issues.

The symptom of running swift without arguments and it "just goes to another line" is caused by missing the exact version of Python. For Swift 5.3.3 release it requires Python 3.9. Python 3.8 or earlier will not work.

To verify this is the case, type echo %ERRORLEVEL% after running swift. If you get -1073741515, this is 0xc0000135 which is the Windows status STATUS_DLL_NOT_FOUND. What's happening is swift.exe is executing lldb.exe, which is loading a DLL which requires python39.dll to be in your path.

See my post for more details.

Terms of Service

Privacy Policy

Cookie Policy