ERROR: Could not find a version that satisfies the requirement mysqldb (from versions: none)

编辑器idea
MySQL 5.5
python 3.9.2
使用编辑器安装mysqldb的时候报错
ERROR: Could not find a version that satisfies the requirement mysqldb (from versions: none)
ERROR: No matching distribution found for mysqldb

ERROR: Could not find a version that satisfies the requirement mysqldb (from versions: none)_第1张图片

网上查阅资料发现
MySQLdb不支持python3环境,因此可以使用PyMySQL完美解决,只需将代码中的MySQLdb换成PyMySQL即可

于是将指令改为
pip install PYMySQL
安装成功
ERROR: Could not find a version that satisfies the requirement mysqldb (from versions: none)_第2张图片

idea如何打开这个界面操作如下
ERROR: Could not find a version that satisfies the requirement mysqldb (from versions: none)_第3张图片


更新
python3可以直接用下面这个命令安装mysqlclient
pip install mysqlclient

你可能感兴趣的:(python,python)