llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

ModuleNotFoundError: No module named 'lldb.embedded_interpreter'

Open iamanonymouscs opened this issue 4 years ago • 24 comments

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

iamanonymouscs avatar May 19 '22 01:05 iamanonymouscs

@llvm/issue-subscribers-lldb

llvmbot avatar May 19 '22 01:05 llvmbot

We'll need a little bit more information. What platform are you on? How did you install lldb?

JDevlieghere avatar May 19 '22 02:05 JDevlieghere

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/

iamanonymouscs avatar May 19 '22 02:05 iamanonymouscs

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.

iamanonymouscs avatar May 19 '22 08:05 iamanonymouscs

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)"

nlsandler avatar May 19 '22 18:05 nlsandler

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.

tgfrerer avatar Jun 06 '22 18:06 tgfrerer

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?

michael-swan avatar Jun 15 '22 21:06 michael-swan

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.

fonqL avatar Jun 29 '22 14:06 fonqL

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🙂

amordo avatar Jul 20 '22 09:07 amordo

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.

jason-kane avatar Sep 15 '22 00:09 jason-kane

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!

junaire avatar Sep 20 '22 02:09 junaire

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!

unlsycn avatar Dec 03 '22 14:12 unlsycn

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/

miguno avatar Jan 11 '23 20:01 miguno

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.

albertlarsan68 avatar Feb 03 '23 09:02 albertlarsan68

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 !

castaway- avatar Apr 11 '23 02:04 castaway-

ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/

worked for me on WSL2, thanks!

Selyss avatar May 13 '23 16:05 Selyss

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.

fwqaaq avatar Jun 26 '23 16:06 fwqaaq

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.

emz00 avatar Oct 05 '23 13:10 emz00

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.

JetForMe avatar Nov 28 '23 06:11 JetForMe

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.

DavidSpickett avatar Nov 28 '23 09:11 DavidSpickett