I am trying to install python-mysqldb for Python 2.7 in Ubuntu 20.04:
$ sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
$ sudo apt update
$ sudo apt install -y python-mysqldb
I get the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python-mysqldb : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages.
Any idea how I can fix it?
I have Python 2.7.18 and Python 3 installed in my Ubuntu 20.04
You have to undo repository addition by
and then download two packages from 18.04 LTS repository and install them by using commands below: