pythonmysql-python

How to fix: no module named 'mysql'


I want to connect my MYSQL DB to the python DB.I have installed pip mysql connector already.I opened pycharm and ran "import mysql.connector". Upon executing this code,I received 'no such module named mysql' error.

import mysql.connector

Solution

  • I don't know what you have tried so far, so I'm not sure if this will solve your problem but check your configuration.

    Also, I'm not quite sure what PyCharm 3.7 is? Did you mean Python 3.7 and PyCharm 2019? (For this answer, I'm using PyCharm Professional 2019 and Python 3.6


    Check your Settings