If apt_pkg.cpython-38-x86_64-linux-gnu.so is found, copy it to apt_pkg.so: sudo cp apt_pkg.cpython-38-x86_64-linux-gnu.so apt_pkg.so The reason this works is that Python is looking for a module called apt_pkg, and the apt_pkg.so file is the shared object that contains the necessary code. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.