Home > Database > Mysql Tutorial > How Do I Install the Python MySQLdb Module Using Pip?

How Do I Install the Python MySQLdb Module Using Pip?

Patricia Arquette
Release: 2024-12-11 10:11:13
Original
317 people have browsed it

How Do I Install the Python MySQLdb Module Using Pip?

Installing Python MySQLdb Module with Pip

To effectively install the MySQLdb module using pip, follow these steps:

pip install mysqlclient
Copy after login

For legacy Python versions, install the MySQL-python module:

pip install MySQL-python
Copy after login

Dependencies

Before running the installation command, ensure the following dependencies are in place:

Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie):

sudo apt-get install python-pip python-dev libmysqlclient-dev
Copy after login

Fedora 24:

sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
Copy after login

Mac OS:

brew install mysql-connector-c
Copy after login

If the mysql-connector-c installation fails, try:

brew install mysql
Copy after login

The above is the detailed content of How Do I Install the Python MySQLdb Module Using Pip?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template