Python Forum

Full Version: Error after installing Python3.8.2: "No module named 'apt_pkg'"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Installation for Python3.8.2 went smoothly. No direct errors. But attempting to update the system (Linux Mint) afterward gives the error message: "No module named 'apt_pkg'"

Setting the default back to Python3.6 fixes the error. But of course I don't want to do that.

I have seen this mentioned before, so I assume that it's a known problem. But have not located any working fixes.

Ideas and speculation appreciated.
This seems more of a question for a Linux Mint forum than a Python one.
I don't think this has much to do with Linux itself. This occurs directly as a result of upgrading Python from 3.6 to 3.7 or 3.8.
The newer version of Python evidently can't find something that the earlier version has access to. Its effect manifests during "sudo apt update" because that is evidently running as a Python process, but I'd have to assume that that is not the only thing that is affected/broken by the Python upgrade.
apt_pkg sounds like a Debian thing, not a Python thing, so +1 to this being a Linux Mint question rather than a Python question. (I get that it's sort of a Python question, but the expertise seems more linux to me.)