Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'lldb.embedded_interpreter' #55575

Open
iamanonymouscs opened this issue May 19, 2022 · 24 comments
Open

ModuleNotFoundError: No module named 'lldb.embedded_interpreter' #55575

iamanonymouscs opened this issue May 19, 2022 · 24 comments
Assignees
Labels

Comments

@iamanonymouscs
Copy link

iamanonymouscs commented May 19, 2022

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 iamanonymouscs changed the title ModuleNotFoundError: No module named 'lldb.embedded_interpreter ModuleNotFoundError: No module named 'lldb.embedded_interpreter' May 19, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented May 19, 2022

@llvm/issue-subscribers-lldb

@JDevlieghere
Copy link
Member

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

@iamanonymouscs
Copy link
Author

iamanonymouscs commented May 19, 2022

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
Copy link
Author

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.

@nlsandler
Copy link

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

@tgfrerer
Copy link

tgfrerer commented Jun 6, 2022

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.

@michael-swan
Copy link

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?

@fonqL
Copy link

fonqL commented Jun 29, 2022

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.

@amordo
Copy link
Contributor

amordo commented Jul 20, 2022

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🙂

@jason-kane
Copy link

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.

@junaire
Copy link
Member

junaire commented Sep 20, 2022

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!

@unlsycn
Copy link

unlsycn commented Dec 3, 2022

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!

@miguno
Copy link

miguno commented Jan 11, 2023

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 #55575 (comment):

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

@albertlarsan68
Copy link

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.

@castaway-
Copy link

castaway- commented Apr 11, 2023

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 !

@Selyss
Copy link

Selyss commented May 13, 2023

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

worked for me on WSL2, thanks!

@fwqaaq
Copy link

fwqaaq commented Jun 26, 2023

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.

@loop-evgeny
Copy link

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.

@JetForMe
Copy link

JetForMe commented Nov 28, 2023

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.

@DavidSpickett
Copy link
Collaborator

That type was removed in 70599d7, 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.

@JinjieZhao
Copy link

export PYTHONPATH=/lib/llvm-14/lib/python3.10/dist-packages:$PYTHONPATH
it works.

@createyourpersonalaccount
Copy link

createyourpersonalaccount commented Jan 25, 2024

There's a bug report on Debian 12. You can append

export PYTHONPATH="/usr/lib/llvm-14/lib/python3.11/dist-packages/:$PYTHONPATH"

to your ~/.bashrc and the error will go away.

@loop-evgeny
Copy link

Even with the workaround, this is quite annoying when trying to automate LLDB installation, because the LLDB version and Python versions differ between Ubuntu versions, so you have to script detecting the installed versions somehow.

Is this something LLDB developers can fix or is it a packaging issue?

@GitMensch
Copy link

GitMensch commented Sep 11, 2024

Both...

You can commonly work around this by switching to the LLDB version that does not have that module any more

sudo apt install lldb-16
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-16 50

fixed that for me on newer systems and if that version isn't available (older systems)

sudo apt install lldb-15
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-15 50
export PYTHONPATH="/usr/lib/llvm-15/lib/python3.10/dist-packages/:$PYTHONPATH"
echo 'export PYTHONPATH="/usr/lib/llvm-15/lib/python3.10/dist-packages/:$PYTHONPATH"' >> ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests