MySQL Connector/Python Developer Guide  /  Connector/Python Installation  /  Verifying Your Connector/Python Installation

4.4 Verifying Your Connector/Python Installation

On Windows, the default Connector/Python installation location is C:\PythonX.Y\Lib\site-packages\, where X.Y is the Python version you used to install the connector.

On Unix-like systems, 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. See How installation works in the Python manual.

The C Extension is installed as in the site-packages directory, not in the mysql/connector directory.

Depending on your platform, the installation path might differ from the default. If you are not sure where Connector/Python is installed, do the following to determine its location. The output here shows installation locations as might be seen on macOS:

$> python
>>> from distutils.sysconfig import get_python_lib

>>> print get_python_lib()            # Python v2.x

>>> print(get_python_lib())           # Python v3.x

To test that your Connector/Python installation is working and able to connect to MySQL Server, you can run a very simple program where you supply the login credentials and host information required for the connection. For an example, see Section 5.1, “Connecting to MySQL Using Connector/Python”.