How to install Python MySQLdb module using pip?(如何使用 pip 安装 Python MySQLdb 模块?)
问题描述
如何使用 pip 为 Python 安装 MySQLdb 模块?
How can I install the MySQLdb module for Python using pip?
推荐答案
这很容易,但很难记住正确的拼写:
It's easy to do, but hard to remember the correct spelling:
pip install mysqlclient
如果您需要 1.2.x 版本(仅限旧版 Python),请使用 pip install MySQL-python
If you need 1.2.x versions (legacy Python only), use pip install MySQL-python
注意:运行上述命令时,某些依赖项可能必须到位.关于如何在各种平台上安装这些的一些提示:
Note: Some dependencies might have to be in place when running the above command. Some hints on how to install these on various platforms:
sudo apt-get install python-pip python-dev libmysqlclient-dev
Fedora 24:
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
Mac 操作系统
brew install mysql-connector-c
如果失败,请尝试
brew install mysql
这篇关于如何使用 pip 安装 Python MySQLdb 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 pip 安装 Python MySQLdb 模块?


基础教程推荐
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在多列上分布任意行 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01