:0: error: could not build C module 'SwiftShims'
I have already followed the instructions and completely restarted 5 times. What is going on!
compnerd
(Saleem Abdulrasool)
3
My guess is that the instructions were not followed precisely. This indicates that the (correct) Visual Studio Build Tools were not installed prior to the Swift installation. As a result the module map is either not installed or the wrong version of the tools are being selected.
I would uninstall swift, and then reinstall from the command line using .\installer.exe /lv*x and look through the logs to determine wat is happening during the deployment phase.
Alternatively follow the instructions to manually deploy the module map files.
Can you please explain the steps I would need to do to complete this?
compnerd
(Saleem Abdulrasool)
5
The manual approach is documented in the getting started/installation instructions on swift.org
For further investigating the installation issue, .\installer.exe /lv*x should be sufficient for producing the necessary logs for determining what happened during the deployment process.
I am sorry but that is the issue, I have done every guide for windows that is listed. I am not sure how to do what the .\installer.exe thing is.
ShikiSuen
(ShikiSuen)
7
Could you please explain why the VS has to be 2019?
I am having VS 2022 installed on my machine for latest dotnet development. I wonder whether installing multiple Visual Studio versions could cause troubles.
ShikiSuen
(ShikiSuen)
9
According to your instruction:
I tried installing Python 3.9 on a fresh-installed windows 10 (21H2) in this way, but the new cmdline shells (CMD, PWSH, Nu Shell, etc.) have no one responds to the pip command.
P.S.: I thought that this must happen. Python is the most irritating thing to deploy on macOS, and now Windows.
sspringer
(Stefan Springer)
11
Are you sure that you opened a new command line window after installing Python?
Can you find the “pip” command following the paths (notice that you typed “pip3”, is this available)? Or is pip missing in your Python installation?
ShikiSuen
(ShikiSuen)
13
Update: I manually downloaded the installer from Python official website, and I confirmed that my remove-and-reinstall process includes adding-to-PATH. It still doesn't work. Sigh.
This is Python. I hate its hassles deploying on macOS, and I learnt Swift to write lots of Swift scripts instead. Now, on Windows, I have to use Python to get Swift works? .......
sspringer
(Stefan Springer)
14
You first might have a look what the exact problem is. You have a new Python installation, so:
- Are the entries in the PATH environment variable pointing to that installation?
- The pip command should be in the “Scripts” subfolder of the Python installation, can you find it there?
- If it is there, is the according folder listet in the PATH environment variable?
- If all is OK so far, can you execute “pip” in a new command line window (I woul€ start trying a cmd window)?
- What if you uninstall Python and install it again?
There is obviously some problem, but without some further investigation on your part it is difficult for other people to see what the problem might be.
ShikiSuen
(ShikiSuen)
15
I tried uninstall-and-install. This is the PATH now:
It still does not work in a new terminal window for PWSH and NuShell.
However, the Visual Studio CMD prompt works for Python now. I just have to use those DOS commands.
sspringer
(Stefan Springer)
16
Python is only needed for the REPL or debugging (I think for debugging this stems from the LLVM debugger which uses Python for configuration), not for compiling or running. Note that you need the exact minor version of Python as documented for the Swift version.
1 Like
ShikiSuen
(ShikiSuen)
17
Now I can prove that the terminal emulator matters. Maybe Fluent Terminal needs extra configuration to work with PATHs. Microsoft Windows Terminal has no problem using pip with NuShell.
sspringer
(Stefan Springer)
18
Well, it should work in a pure (and new) PowerShell window, too.
1 Like
ShikiSuen
(ShikiSuen)
19
Thanks. It's assumable. I just prefer NuShell: It offers a more bash-like experience comparing to PWSH. It does have a lot of differences comparing to bash, still.
sspringer
(Stefan Springer)
20
Then NuShell should maybe be restartet?
So all is solved.
Have fun with Swift!
1 Like
ShikiSuen
(ShikiSuen)
21
Thanks. The PIP problem is solved.
However, the SwiftShim issue still exists. I am manually installing 2019 VC Tools components through VS 2022 installer to see whether it can fix this.