MySQL Connector/Python Developer Guide

4.2 Installing Connector/Python from a Binary Distribution

Installing Connector/Python with pip

Use pip to install and upgrade Connector/Python:

# Installation
$> pip install mysql-connector-python

# Upgrade
$> pip install mysql-connector-python --upgrade

# Optional, installs the X DevAPI interface
$> pip install mysqlx-connector-python

Installing Connector/Python on Microsoft Windows

Use pip; installing Python on Windows also makes pip available from the command line (cmd.exe).

Installing Connector/Python on macOS

Use pip; installing Python on macOS also makes pip available.

Note

DMG installer packages were available before Connector/Python 8.1.0.

Installing Connector/Python on Linux Using the MySQL Yum Repository

EL-based platforms can optionally use RPMs instead of pip, either by using the Connector/Python RPM downloads or by using the MySQL Yum repository (see Installing Additional MySQL Products and Components with Yum and Adding the MySQL Yum Repository).

RPM Prerequisites

$> sudo yum install mysql-community-client-plugins

Then install Connector/Python as follows:

$> sudo yum install mysql-connector-python

Installing Connector/Python on Linux Using an RPM Package

Connector/Python Linux RPM packages (.rpm files) are available from the Connector/Python download site (see Section 4.1, “Obtaining Connector/Python”).

To install a Connector/Python RPM package (denoted here as PACKAGE.rpm), use this command:

$> rpm -i PACKAGE.rpm

Prerequisites

RPM provides a feature to verify the integrity and authenticity of packages before installing them. To learn more, see Verifying Package Integrity Using MD5 Checksums or GnuPG.