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


Connectors and APIs Manual  /  ...  /  Verifying Your Connector/Python Installation

6.4.6 Verifying Your Connector/Python Installation

Verifying Installations by pip

To verify that a Connector/Python package has been installed successfully using pip, use the following command:

Press CTRL+C to copy
$ pip install list

If you have installed the classic interface, you should see an output similar to the following:

Press CTRL+C to copy
Package Version ---------------------------------------- ---------- ... ... mysql-connector-python x.y.z ... ...

If you have installed X DevAPI, you should see an output similar to the following:

Press CTRL+C to copy
Package Version ---------------------------------------- ---------- ... ... mysqlx-connector-python x.y.z ...

Installed from an RPM

The default Connector/Python installation location is /prefix/pythonX.Y/site-packages/, where prefix is the location where Python is installed and X.Y is the Python version.

The C Extension is installed as _mysql_connector.so and _mysqlxpb.so in the site-packages directory, not in the mysql/connector and mysqlx directories for the classic interface and X DevAPI, respectively.

Verify the C-extension

To verify the C-extension of the classic package is available, run this command:

Press CTRL+C to copy
$ python -c "import mysql.connector; assert mysql.connector.HAVE_CEXT; print(f'C-ext is {mysql.connector.HAVE_CEXT}')"

If no error is returned, the C-extension has been correctly built and installed.

Similarly, to verify the C-extension of the X DevAPI package is available, run this command and see if it returns any errors:

Press CTRL+C to copy
$ python -c "import mysqlx; assert mysqlx.protobuf.HAVE_MYSQLXPB_CEXT; print(f'C-ext is {mysqlx.protobuf.HAVE_MYSQLXPB_CEXT}')"