Having moved to Python 3.11, I need to update Connector/Python - which requires the MariaDB Connector/C library.

This library is normally installed with

python -m pip install mariadb

But I'm getting an error:

MariaDB Connector/Python requires MariaDB Connector/C >= 3.3.1, found version 3.1.20

I can't see an ARM distribution for Connector/C on the mariadb pages, so I downloaded and build from source. All good.

  • How do I install the newly built library?
  • Or even remove the old version so the pip install will pick up the connect version?

mariadb server is '10.3.38-MariaDB-0+deb10u1 Raspbian 10', working fine. Just cannot connect to it from Python!

  • "Having moved to Python 3.11" HOW?? WHY?? If you choose to use an unsupported version you need to do everything from scratch. You aren't even using the appropriate commands for Buster; python2 is obsolete. If for some reason you think you need a different version you should use virtual environment.
    – Milliways
    Mar 18 at 9:35
  • My python3 environment is working fine in all respects except this. I'm not sure why you think I'm using python2 - my 'python' command is aliased to python3.
    – tyddynonn
    Mar 18 at 12:07

1 Answer 1


Very simple in the end - after building the Connector/C Library, I needed to

'sudo make install'

'python -m pip install mariadb' then ran fine.

Couple of wrinkles to watch out for:

  • You may need to make the Connector/C and MariaDb socket configurations line up. See https://stackoverflow.com/questions/57419743/change-socket-address-mariadb-config
  • The new Connector/C Libraries get built to the location specified in the cmake config. I then had to manually copy them to /usr/lib/arm-linux-gnueabihf which seems to be where the Python connector is looking for them. I'm sure there will be a better way to do this, but it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.