【发布时间】:2021-09-21 01:23:42
【问题描述】:
将我的 Django 项目连接到托管在远程 VM 上的数据库时,当我运行 python3 manage.py run server 时出现错误
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
当我尝试python3 -m pip install mysqlclient 解决依赖关系时,我得到了错误
ERROR: Could not find a version that satisfies the requirement mysqlclient (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3)
ERROR: No matching distribution found for mysqlclient
我想了解导致这些问题的原因以及如何解决。
提前致谢!
【问题讨论】:
-
你的 Python 版本是多少?发布
python3 -V的输出。 -
我运行它,它返回 Python 3.9.7
-
我要工作了!我跑了
brew install mysql