Python Forum
Error after installing Python3.8.2: "No module named 'apt_pkg'"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error after installing Python3.8.2: "No module named 'apt_pkg'"
#1
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.
Reply
#2
This seems more of a question for a Linux Mint forum than a Python one.
Reply
#3
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.
Reply
#4
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.)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 663 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  ERROR WHILE INSTALLING PLAYSOUND MODULE satwants33 1 906 Dec-26-2023, 04:37 PM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 22,600 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,066 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,240 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,340 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,168 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 918 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 7,919 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 904 May-15-2023, 02:38 PM
Last Post: tonynapoli2309

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020