Belphegor Belphegor - 2 months ago 28
Linux Question

python-dev installation error: ImportError: No module named apt_pkg

I am Debian user, and I want to install python-dev, but when I run the code in the shell as a root:

# aptitude install python-dev

I get the following error:

Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 28, in <module>
import apt_pkg
ImportError: No module named apt_pkg

What seems to be the problem and how can I resolve it?


Make sure you have a working python-apt package. You could try and remove and install that package again to fix the problem with not being located.

apt-get install python-apt