import lldb
在从发布包中安装LLDB之后(在Lubuntu 15.04上:sudo apt-get install lldb),我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/lldb/__init__.py", line 52, in <module>
_lldb = swig_import_helper()
File "/usr/lib/python2.7/dist-packages/lldb/__init__.py", line 44, in swig_import_helper
ImportError: No module named _lldb
这是预期的!LLDB页面上写道:
LLDB has a Python scripting capability and supplies its own Python module named lldb. If a script is run inside the command line lldb application, the Python module is made available automatically. However, if a script is to be run by a Python interpreter outside the command line application, the PYTHONPATH environment variable can be used to let the Python interpreter find the lldb module.
The correct path can be obtained by invoking the command line lldb tool with the -P flag:
> export PYTHONPATH=`$llvm/build/Debug+Asserts/bin/lldb -P`
If you used a different build directory or made a release build, you may need to adjust the above to suit your needs.
所以那些有信心自己构建LLDB的人会得到清晰的指导,而只想使用发布包的新手则只能得到模糊的解释...
有人弄清楚了“根据需要调整上面的内容”具体意味着什么吗?尤其是在你从发布包中安装所有内容的最基本情况下?lldb -P报告的路径并不能解决这个问题:
user@user-VirtualBox:~$ lldb -P
/usr/lib/x86_64-linux-gnu/python2.7/site-packages
user@user-VirtualBox:~$ ls /usr/lib/x86_64-linux-gnu/python2.7/site-packages
ls: cannot access /usr/lib/x86_64-linux-gnu/python2.7/site-packages: No such file or directory
apt-get install python-six
安装six
模块。 - zekel