Install MariaDB Connector/Python

MariaDB Connector/Python can be installed in multiple ways.

Dependencies

MariaDB Connector/Python has the following dependencies:

Software

Version

MariaDB Connector/C

  • Connector/C 3.1.5 or later (Connector/Python 1.0)

  • Connector/C 3.2.4 or later (Connector/Python 1.1 Beta)

Python 3

CPython 3.6 or later

Install from PyPI

  1. Install MariaDB Connector/C, which is a dependency.

  2. Use PIP to install MariaDB Connector/Python through PyPI:

    To install the latest Connector/Python 1.0 release, execute the following:

    $ pip3 install mariadb==1.0.8
    

    If you would like to install a non-GA release, such as the latest Connector/Python 1.1 Beta release, the --pre option must be specified:

    $ pip3 install --pre mariadb==1.1.0-beta2
    

Install from Source

  1. Install MariaDB Connector/C, which is a dependency.

  2. Download the MariaDB Connector/Python/source tarball at: https://mariadb.com/downloads/#connectors

  3. Extract the source tarball:

    $ mkdir mariadb-connector-python
    $ cd mariadb-connector-python
    $ tar -xvzf ../mariadb-connector-python-1.0.8.tar.gz
    
  4. Use PIP to install MariaDB Connector/Python from source:

    $ pip3 install ./mariadb-*
    

    If you would like to install a non-GA release, such as the latest Connector/Python 1.1 Beta release, the --pre option must be specified:

    $ pip3 install --pre ./mariadb-*