I recently installed python 3.7 on a Ubuntu 18.04.4 LTS machine using the following command:
sudo apt-get install python3.7
I also ran the following command since I want python 3.7 to be run as
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
Subsequently I followed a suggestion to run this:
sudo apt autoremove
And now when I try to enable the
universe repository (
add-apt-repository universe), I get the following error:
Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 11, in <module> from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 28, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'
What else can I try?
Here and here are also suggestions that involve specifically pointing to the dist installation of python, which is version 3.6 for Ubuntu 18.04. Is it safe to do this? Couldn't this python be upgraded at some point?