我正在尝试在 Ubuntu 20.04 中为 Python 2.7 安装 python-mysqldb:
$ sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
$ sudo apt update
$ sudo apt install -y python-mysqldb
我收到以下错误:
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.
知道如何解决吗?
我的 Ubuntu 20.04 中安装了 Python 2.7.18 和 Python 3
您必须通过以下方式撤消存储库添加
然后从 18.04 LTS 存储库下载两个包并使用以下命令安装它们: