I have recently installed python3.9
I tried re-running update and it returns with the same error
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 12, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists...
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 > /dev/null; fi'
E: Sub-process returned an error code
I'd would be lying if I said I understood in detail the update process, but it looks like, for some
reason a python script, creator.py, is run at some point and in line 12 of that file, trys to import
a module called apt_pkg which fails.
So I have to figure out what all this is.

Thanks for your help. I will report back. Currently doing tax returns so
it may be a couple of days.