当我启动 gdb(在 Ubuntu 12.04 LTS 上)时,它立即崩溃并显示以下输出:
BlockquoteTraceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 337, in _init_posix
makefile = _get_makefile_filename()
File "/usr/lib/python2.7/sysconfig.py", line 331, in _get_makefile_filename
return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
来自这两个类似的问题
https://stackoverflow.com/questions/10641201/attributeerror-module-object-has-no-attribute-pydebug
似乎gdb
捕获了错误的 Python 安装?我如何知道gdb
应该使用哪个 Python,以及我在哪里设置使用哪个 Python?
我有一条 python 在/usr/lib/python2.7
,还有一条 在/opt/ros/fuerte/lib/python2.7
。
我之前曾gdb
在这台机器上使用过,成功。
谢谢!
答案1
如果不从源代码构建,您就无法配置它应该使用哪个 Python;您所能做的就是运行以下命令:
readelf -d $(which gdb) | grep python
找出它使用的 Python。