如何使用pip安装Python MySQLdb模块?
16lz
2021-01-22
How can I install the MySQLdb module for Python using pip?
如何使用pip为Python安装MySQLdb模块?
12 个解决方案
#1
392
It's easy to do, but hard to remember the correct spelling:
这很容易做到,但很难记住正确的拼写:
pip install mysqlclient
If you need 1.2.x versions (legacy Python only), use pip install MySQL-python
如果你需要1.2。x版本(仅遗留Python),使用pip安装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:
注意:在运行上述命令时,可能需要设置一些依赖项。关于如何在各种平台上安装这些软件的一些提示:
Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie)
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 OS
brew install mysql-connector-c
if that fails, try
如果失败,试一试
brew install mysql
更多相关文章
- Python/模块与包之模块
- eclipse调用python模块是出错及解决
- python3 爬虫之requests模块使用总结
- pip常用命令汇总
- 面试---Python中的模块和包是什么?
- pip常用命令、配置pip源
- python及其模块下载集合
- python的turtle模块画折线图
- centos7 安装 Python PIL模块