What does the error 'ModuleNotFoundError: No module named 'mysql.connector'' mean, and how do I fix it?

Question

Grade: Education Subject: Support
What does the error 'ModuleNotFoundError: No module named 'mysql.connector'' mean, and how do I fix it?
Asked by:
103 Viewed 103 Answers

Answer (103)

Best Answer
(366)
This error means Python cannot find the 'mysql.connector' module. It's a direct indication that the library isn't installed or isn't accessible to Python. Solution: Use `pip install mysql-connector-python` to install the library. If you have multiple Python installations, make sure you're using the correct `pip` for the interpreter you're using to run your script.