Connection pooling with python mysql-connector I would like to use connection pooling with mysql-connector 2.1.5

On Ubuntu everything works fine, but I would like to switch to Alpine and have used this file to install the connector (as described here).

The installation seems to work. I can use mysql.connector.connection(), but whenever I try mysql.connector.pooling.MySQLConnectionPool() I get the error AttributeError: 'module' object has no attribute 'pooling'.

I have also tried creating a pool implicitly using cnxpool = mysql.connector.connection(pool_name="...") but I cannot get the connection. Everytime I try cnx = cnxpool.get_connection() I get the error AttributeError: 'MySQLConnection' object has no attribute 'get_connection'

Is there any way to use pooling with the platform independent install package, or is it just not implemented there?
I did some experimentation in console trying to figure out why this was happening for me as well. In the end, I searched right into the file folder for the package looking to ensure that the pooling file was present in the mysql.connector package version I had.

Sure enough there it was.

In the end, I simply changed my import statement. I had been using

import mysql.connector
pool = mysql.connector.pooling.MySQLConnectionPool(**config)


After playing in console for a bit I realized that it would be happy if I just used;

import mysql.connector
from mysql.connector import pooling
pool = pooling.MySQLConnectionPool(**config)


Worked fine. Couldn't tell you "why", but it worked.