![]() |
No module named 'apt_pkg' - Printable Version +- Linux Lite Forums (https://www.freecinema2022.gq/forums) +-- Forum: Software - Support (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=5) +--- Forum: Updates (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=46) +--- Thread: No module named 'apt_pkg' (/showthread.php?tid=9018) |
No module named 'apt_pkg' - starnekit - 01-01-2024 Hello! I've tried to update several times with "sudo apt update", but anytime I have the same error with apt_pkg Does anyone knows what the problem it could be? For extra info - I installed some freshly versions of Python, maybe it broke the update system? Thank you very much! Code: =========================== Re: No module named 'apt_pkg' - stevef - 01-02-2024 It is possible that changing the python version has caused many function scripts to stop working. What do these commands indicate ? Code: inxi -S Code: python3 -V Code: ls -l /usr/bin/python* Re: No module named 'apt_pkg' - starnekit - 01-02-2024 Thanks for the answer! Those commands indicates: Code: inxi -S Code: python3 -V Code: ls -l /usr/bin/python* Re: No module named 'apt_pkg' - stevef - 01-02-2024 The required system default python for Linux Lite 6.6 is 3.10. What instructions did you follow to install python 3.11 ? If python 3.11 became system default during the install, is almost certainly the cause of the problem. Re: No module named 'apt_pkg' - starnekit - 01-02-2024 Quote:What instructions did you follow to install python 3.11 ? I searched in my browser history Seems like I used this guide https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-11-on-ubuntu-20-04-and-22-04-lts/ which connected with using "deadsnakes" repo I think it closely correlates with the problems people had in this thread https://stackoverflow.com/questions/13708180/python-dev-installation-error-importerror-no-module-named-apt-pkg So as I understand I should move the apt_pkg into the never Python folder or maybe say Linux to use python 3.10 as the default again, right? Re: No module named 'apt_pkg' - starnekit - 01-02-2024 Ok, I think I fixed it! I used Code: sudo update-alternatives --config python3 I want to believe I used the right way Re: No module named 'apt_pkg' - stevef - 01-03-2024 You can have different versions of python in parallel on your system, but if the system default is changed it is likely to cause problems. The worrying bit in the instructions you linked to is Quote:.... and configure it as the default version of Python in Ubuntu 20.04 and 22.04 LTS.This should come with a warning really. The comments under the instructions show that others also had problems after following the instructions. Quote:I want to believe I used the right wayIt was necessary to reverse whatever was done to change the system default - so step 4 of the instruction needed to be undone which you did. Re: No module named 'apt_pkg' - starnekit - 01-03-2024 Thanks a lot for your help! ![]() |