ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
lldb is already the newest version (1:15.0-55~20220216125911.2).
$ lldb --version
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
lldb version 15.0.0
@llvm/issue-subscribers-lldb
We'll need a little bit more information. What platform are you on? How did you install lldb?
I am running lldb in Ubuntu 22.04 LTS. Following is the platform information:
$ uname -a
Linux ea22053d0460 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I installed the development branch of lldb following this website (LLVM Ubuntu nightly packages): https://apt.llvm.org/
We'll need a little bit more information. What platform are you on? How did you install lldb?
I think it is worthy to note that my ubuntu is running inside a container.
I see the same behavior in LLDB 14 on Ubuntu 20.04 (not running in a container), installed with
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
I had the same situation as @nlsandler - following the steps outlined in this bug report on launchpad.net: https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1972855 solved it for me.
It appears that the issue is down to a mismatch in python paths.
I suspect OP's issue is the same as mine. lldb -P returns /usr/lib/lib/python3.8/site-packages for LLDB builds from deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 repos. It should instead return /usr/lib/llvm-14/lib/python3.8/site-packages which is where these Python dependencies are installed. Any ideas where this mistake originates?
Same here. Win10 wsl2. After updating Ubuntu from 20.04 to 22.04, I found lldb still kept version 10 so I ran apt-get -u dist-upgrade and upgraded again. lldb turned to version 14.0.0 now but came with this problem.
Thanks for the link, @tgfrerer
tldr: lldb -P prints destination, which doesn't exist; do mkdir -p /usr/lib/local/lib/python3.10 && ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages /usr/lib/local/lib/python3.10/dist-packages
maybe your llvm-14 dir is located/named different🙂
with ubuntu 22.04 and swift 5.7 I had to:
apt install python3-lldb-14
ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
before "swift repl" would work without errors.
with ubuntu 22.04 and swift 5.7 I had to:
apt install python3-lldb-14 ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/before "swift repl" would work without errors.
I'm on ubuntu22, installed lldb by apt. this works for me. Thanks!
with ubuntu 22.04 and swift 5.7 I had to:
apt install python3-lldb-14 ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/before "swift repl" would work without errors.
works for me on WSL2. thx!
Same here on WSL2 with Ubuntu 22.04 with latest updates applied, lldb installed via apt.
$ lldb --version
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
lldb version 14.0.0
$ lldb -P
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
/usr/lib/local/lib/python3.10/dist-packages
$ ls -l /usr/lib/local/lib/python3.10/dist-packages
ls: cannot access '/usr/lib/local/lib/python3.10/dist-packages': No such file or directory
Workaround fix, thanks to https://github.com/llvm/llvm-project/issues/55575#issuecomment-1251752632:
$ sudo ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
If you aren't admin, you can work around this by setting your PYTHONPATH env variable to /usr/lib/llvm-14/lib/python3.10/dist-packages.
Same here with Ubuntu v22.10 / lldb v15.0.6 ;)
lldb -P would give me:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
/usr/lib/local/lib/python3.10/dist-packages
Workaround using proper path for lldb v15
sudo ln -s /usr/lib/llvm-15/lib/python3.10/dist-packages/lldb /usr/lib/local/lib/python3.10/dist-packages/lldb
the correct path should use "llvm-xx" instead of "local", that was the only diff Thanks for the temporary fix !
ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
worked for me on WSL2, thanks!
sudo ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
Thanks, and add sudo for this command.
The workaround works, but it would be great to fix this finally. This has been open for over a year and has wasted time for a lot of people.
I just installed Swift 5.9 on Debian 12 (on a RPi Pico) and ran into this issue running the Swift REPL. Eventually I found this issue. I tried the above command to link the bits, but now I get this:
$ swift repl
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/lldb/__init__.py", line 952, in <module>
eArgTypeReproducerProvider = _lldb.eArgTypeReproducerProvider
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module '_lldb' has no attribute 'eArgTypeReproducerProvider'
Welcome to Swift version 5.9.1 (swift-5.9.1-RELEASE).
Type :help for assistance.
1>
UTA: This is with lldb-15 and python3-lldb-15.
That type was removed in https://github.com/llvm/llvm-project/commit/70599d70273b671b1b2e6a0e0b9c11e413209647, which was first present in lldb 16.
I can't tell who's throwing that error, could be a mismatch between the version swift expects to find and the installed library version.