Running swift for the first time (error message: lldb: error while loading shared libraries)

Hi!

Today is my first day using Swift.
I downloaded it from swift.org.
When I try to run the command "swift", the term returns this error message:

/home/ddraig/Swift/usr/bin/lldb: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

But Python3 is installed...
What can I do now?

Thank you for any help.

What OS and Swift version are you using? On linux, you might need to update the Python version, or if you'd rather just use what you have, you could add a symbolic link so lldb uses that: sudo ln -s /usr/lib64/libpython3.10.so.1.0 /usr/lib64/libpython3.8.so.1.0. I just did the latter when running the Swift debugger from the Swift 5.5.2 toolchain on Fedora Core 35 without a problem.

Btw, the reason running swift calls lldb is that you're starting the REPL, which uses lldb, but you're more likely going to want to use the package manager to build packages instead.

Hello dear user Buttaface!

I apologize for the delay in answering you.
Thank you so much for your help.
I had to reinstall Ubuntu because I found out, using the python3 --version command, that my version was 3.9 , but swift requires 3.8 (I was using the Ubuntu 21, and now I am using ubuntu 20.4).
I know Fedora, it is a awesome distro, I used it a few years ago (sometimes I think I used every distro available lol)
I will keep all your tips for future reference, you were very kind.
A wonderful weekend for you!

Alexandre.

I am also seeing this issue on Ubuntu 21.10, which doesn't provide Python 3.8, but rather 3.9 and 3.10.

I was unable to make a downgrade, I had to reinstall Ubuntu, installing the version 20.
After that, everything worked fine: now I can use swift!
By the way, in another thread, an user told me that there is a SwiftUI-compatible framework for building browser apps in Linux, called Tokamak U. I. :

https://github.com/TokamakUI/Tokamak

Happy coding.

Terms of Service

Privacy Policy

Cookie Policy