I'm using ubuntu 14.04 and I have messed up python. First, I've installed python 3.6.8, but I had some problem with it, so I moved to python 3.6.1. Only way to invoke 3.6.1 version is to use python3.6, but I need to make it work by using python. When i try alias, it kinda works, but not everywhere. I wanted to install ffmpeg, but when I use:
sudo add-apt-repository ppa:mc3man/trusty-media
I'm getting an error that says
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 27, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Then, when I try to fix this with
apt-get install python-apt
I get another error
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-apt is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
16 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up lsb-release (4.1+Debian11ubuntu6.2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package lsb-release (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-apt (0.9.3.5ubuntu3) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-apt (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-chardet (2.0.1-2build2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-chardet (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-colorama (0.2.5-0.1ubuntu2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-colorama (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-distlib (0.1.8-1ubuntu1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-distlib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-six (1.5.2-1ubuntu1.1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-six (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-html5lib:
python-html5lib depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-html5lib (--configure):
dependency problems - leaving unconfigured
Setting up python-pkg-resources (3.3-1ubuntu2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-pkg-resources (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python-urllib3:
python-urllib3 depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-urllib3 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-requests:
python-requests depends on python-chardet; however:
Package python-chardet is not configured yet.
python-requests depends on python-urllib3 (>= 1.7.1); however:
Package python-urllib3 is not configured yet.
dpkg: error processing package python-requests (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-setuptools:
python-setuptools depends on python-pkg-resources (= 3.3-1ubuntu2); however:
Package python-pkg-resources is not configured yet.
dpkg: error processing package python-setuptools (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-pip:
python-pip depends on python-colorama; however:
Package python-colorama is not configured yet.
python-pip depends on python-distlib; however:
Package python-distlib is not configured yet.
python-pip depends on python-html5lib; however:
Package python-html5lib is not configured yet.
python-pip depends on python-pkg-resources; however:
Package python-pkg-resources is not configured yet.
python-pip depends on python-requests; however:
Package python-requests is not configured yet.
python-pip depends on python-setuptools (>= 0.6c1); however:
Package python-setuptools is not configured yet.
python-pip depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-pip (--configure):
dependency problems - leaving unconfigured
Setting up python-wheel (0.24.0-1~ubuntu1.1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-wheel (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of unattended-upgrades:
unattended-upgrades depends on lsb-release; however:
Package lsb-release is not configured yet.
dpkg: error processing package unattended-upgrades (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-software-properties:
python3-software-properties depends on lsb-release; however:
Package lsb-release is not configured yet.
python3-software-properties depends on unattended-upgrades; however:
Package unattended-upgrades is not configured yet.
dpkg: error processing package python3-software-properties (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of software-properties-common:
software-properties-common depends on python3-software-properties (= 0.92.37.8); however:
Package python3-software-properties is not configured yet.
dpkg: error processing package software-properties-common (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
lsb-release
python-apt
python-chardet
python-colorama
python-distlib
python-six
python-html5lib
python-pkg-resources
python-urllib3
python-requests
python-setuptools
python-pip
python-wheel
unattended-upgrades
python3-software-properties
software-properties-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
And I'm stuck at this point. I think that when I run those commands, it's invoking python 3.6.8, but I want to use 3.6.1 version. What can I do?