No module name apt_pkg

This problem occurred after i forcefully download the python3.7 and replaced the symbolic link of python3 from python3.6 to python3.7.

A cheating method is to run this:
cd /usr/lib/python3/dist-packages,
sudo ln -s apt_pkg.cpython-{36m,37m}
I am basically creating a symbolic link from Because the python3 is pointing to 3.7 it is also looking for the apt_pkg that is 37m.

So as a lesson try not to change the current python3 that is currently running on linux instead compile the python3.7 and do a make altinstall so that you can use python3.7 without affecting the current python3.

For installation of python3.7 on linux I recommend this post.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s