Ubuntu18.04——apt-get update报错解决:ModuleNotFoundError: No module named ‘apt_pkg‘;E: Problem executing

The error is as follows:

Insert picture description here

the reason

Because here apt-get updatewill depend on the python3.6 version, because your current python3 is another version, it will cause this problem, so you only need to convert its python3 version back to 3.6.

Solution

Just modify the soft connection. When using python3.7, just type python3.7 directly.

cd /usr/bin
sudo rm /usr/bin/python3
sudo ln -s python3.6 python3

Just reinstall pip3.

sudo apt-get remove python3-pip
sudo apt install python3-pip
sudo ./pip3 -V

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_45779334/article/details/115131536