gpt4 book ai didi

python-2.7 - 如何在 Ubuntu 20.04 (Focal Fossa) 中为 Python 2.7 安装 python-mysqldb?

转载 作者:行者123 更新时间:2023-12-04 11:54:12 28 4
gpt4 key购买 nike

我试过“apt-get install python-mysqldb”,结果是:

root@ps1svr:~# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-mysqldb' has no installation candidate
注意:“apt-get install python3-mysqldb”有效,但是我有很多为 Python 2.x 编写的代码不再运行,这导致了很多问题,我可能不得不重新安装 Ubuntu 18.04

最佳答案

您也可以添加 Ubuntu 18.04 存储库来安装 python-mysqldb 包:

sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb

关于python-2.7 - 如何在 Ubuntu 20.04 (Focal Fossa) 中为 Python 2.7 安装 python-mysqldb?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63457213/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com