Trying to install gdb-peda, but am having issues compiling gdb with python 2 support instead of python 3 support. I have

python-dev for 2.7, 
build-dep nmon,
and libncurses5-dev

installed. I installed gdb-peda before I uninstalled and subsequently compiled gdb.

~/gdb-7.8$ ./configure --with-python
~/gdb-7.8$ make all
~/gdb-7.8$ sudo make install

GDB installs without errors (after I installed the necessary libraries), but when I run it I get:

Traceback (most recent call last):
  File "~/peda/peda.py", line 23, in <module>
Exception: Python3 is not supported at the moment, downgrade you GDB or recompile with Python2!

This is the same error I got before I reinstalled gdb.


An easier way to install gdb with Python 2.7 support is:

sudo apt-get remove gdb
wget http://security.ubuntu.com/ubuntu/pool/main/g/gdb/gdb_7.4-2012.02-0ubuntu2_amd64.deb
sudo dpkg -i ./gdb_7.4-2012.02-0ubuntu2_amd64.deb

Substitute i386 for amd64 if necessary.

The first line removes the current gdb version. The second will download gdb from a previous version. And the last line installs it.

| improve this answer | |

For this issue you are having 2 ways:

Recompile GDB --with-python=python2 (or) Downgrade GDB.

For downgrading you need one mirror support older GDB: http://virror.hanoilug.org/ubuntu/virror_precise_sources.list You need synaptic. Search GDB, chose Package/Force Version/Chose 7.4. Confirm and install now.

| improve this answer | |

You can install another version what has been extended by Zach Riggle to add some features and give dual-compatibility with Python2 and Python3.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.