5

When I launch gdb (on Ubuntu 12.04 LTS) it immediately crashes with the following output:

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'

From these two similar questions

gdb cannot run due to python error

https://stackoverflow.com/questions/10641201/attributeerror-module-object-has-no-attribute-pydebug

it seems gdb catches the wrong python install? How do I know which python gdb should use and where do I set which is used?

I have one python in /usr/lib/python2.7 and one in /opt/ros/fuerte/lib/python2.7.

I have previously used gdb successfully on this machine.

Thanks!

Isak T.
  • 151

1 Answers1

4

You can't configure which Python it should use without building from sources; all you can do is run something like:

readelf -d $(which gdb) | grep python

to find out which Python it uses.

SamB
  • 252