ModuleNotFoundError: No module named ‘mysql’

Error: ModuleNotFoundError: No module named ‘mysql’ . While executing the Python program which uses the MySQL import statement returns the following error:

Traceback (most recent call last):

  File "C:\Users\E3019447\.spyder-py3\untitled9.py", line 8, in <module>
    import mysql.connector

ModuleNotFoundError: No module named 'mysql'

Cause: PIP package for Mysql is not installed.

Solution: Install the pip package for MySQL.

pip install mysql-connector-python

This entry was posted in Python on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply