How to fix ‘ModuleNotFoundError: No module named ‘apt_pkg’?

In my case the problem was due to upgrading python version from 3.6 to 3.8.

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2

sudo update-alternatives --config python3

Solved by:

Settings back the python version to 3.6

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)