cannot import name ‘Error’ from ‘mysql.connector’

By | May 28, 2023

To solve the error below:

from mysql.connector import Error
ImportError: cannot import name 'Error' from 'mysql.connector' (unknown location)

I needed to install mysql_connector via:

pip3 install mysql_connector

I had already installed mysql via:

pip3 install mysql-connector-python

But python needs both.

Leave a Reply

Your email address will not be published. Required fields are marked *