0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PythonでLLDBモジュールをimportして使うには

0
Posted at

PythonファイルでLLDBをimportしたけど参照できない、、、

MacOSでLLDBを使いたいのに使えない !!

LLDBはPythonとは異なるC++ラッパーのモジュールなので、下のようにimportをつけて使おうとしても、プログラムを実行するときに以下のようなエラーが出て終了してしまう。
Screenshot 2025-04-24 at 16.50.06.png
外部モジュールなので、pip install lldbしても、「そのようなモジュールはない」と言われる。
Screenshot 2025-04-24 at 16.49.32.png
諦めて他のデバッガであるGDBを使おうにも認証がどうたらこうたらでなんか使えない。どうするべきか?

LLDBの外部フォルダをpythonプロジェクトに含めれば解決!!

homebrewでllvmをインストール brew install llvm して、そのフォルダの中からlldbフォルダを見つけて(llvm/prebuilt/darwin-x86_64/lib/python3.XX/site-packagesの中にあるかな?)、そのフォルダをプロジェクトにコピペしたら使える!! (lldbのバージョンはhomebrewの内部のpythonのバージョンとなることに注意!! 自分はpython3.11だった。)
Screenshot 2026-02-15 at 1.29.45.png
こんな感じに入れてみよう!!

備考

自分はこの解決法を用いたが、パスを通す方法もあるかもしれない。今後その方法を見つけたら追記しようと思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?