Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.5Mb
PDF (A4) - 4.5Mb


6.4.4.1 Installing Connector/Python with pip

Installation via pip is supported on Windows, macOS, and Linux platforms.

Note

For macOS platforms, DMG installer packages were available for Connector/Python 8.0 and earlier.

Use pip to install and upgrade Connector/Python:

Press CTRL+C to copy
# Installation $> pip install mysql-connector-python # Upgrade $> pip install mysql-connector-python --upgrade # Optionally, install X DevAPI $> pip install mysqlx-connector-python # Upgrade X DevAPI $> pip install mysqlx-connector-python --upgrade

In case the wheel package you want to install is found in your local file system (for example, you produced a wheel package from a source distribution or downloaded it from somewhere), you can install it as follows:

Press CTRL+C to copy
# Installation $ pip install /path/to/wheel/<wheel package name>.whl
Installation of Optional Features

Installation from wheels allow you to install optional dependencies to enable certain features with Connector/Python. For example:

Press CTRL+C to copy
# 3rd party packages to enable the telemetry functionality are installed $ pip install mysql-connector-python[telemetry]

Similarly, for X DevAPI:

Press CTRL+C to copy
# 3rd party packages to enable the compression functionality are installed $ pip install mysqlx-connector-python[compression]

These installation options are shortcuts to install all the dependencies needed by some particular features (they are only for your convenience, and you can always install the required dependencies for a feature by yourself):

  • For the classic protocol:

    • dns-srv

    • gssapi

    • fido2

    • telemetry

  • For X Protocol:

    • dns-srv

    • compression

You can specify a multiple of these options in your installation command, for example:

Press CTRL+C to copy
$ pip install mysql-connector-python[telemetry,dns-srv,...]

Or, if are installing a wheel package from your local file system:

Press CTRL+C to copy
$ pip install /path/to/wheel/<wheel package name>.whl[telemetry,dns-srv,...]