title: How to fix 'ModuleNotFoundError: No module named 'apt_pkg'?
body: <p>I'm running code <code>sudo apt update</code> and fetch error </p>
  
  <blockquote>
    <p>ModuleNotFoundError: No module named 'apt_pkg'. </p>
  </blockquote>
  
  <p>Please, help me solve it. </p>
  
  <pre><code>sudo apt update
  
  
  Hit:20 http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu bionic InRelease       
  Fetched 93,3 kB in 2s (42,4 kB/s)                   
  Traceback (most recent call last):
    File "/usr/lib/cnf-update-db", line 8, in &lt;module&gt;
      from CommandNotFound.db.creator import DbCreator
    File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in &lt;module&gt;
      import apt_pkg
  ModuleNotFoundError: No module named 'apt_pkg'
  Reading package lists... Done
  E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db &gt; /dev/null; fi'
  E: Sub-process returned an error code
  </code></pre>