Search code examples
pythonmysql-connector-python

importing mysql connector for python in visual studio code


I want to import mysql connector for python in visual studio code but it is giving error like this :

ModuleNotFoundError: No module named 'mysql.connnector'

what should I do??

I am tring to getting the python connnectivity for that ,I want know answer of this quetion .


Solution

  • You have to install it first through PIP.

    pip install mysql-connector-python
    

    Then you can use this in your code

    from mysql.connector
    

    Find more here:

    https://pypi.org/project/mysql-connector-python/

    https://dev.mysql.com/doc/connector-python/en/connector-python-introduction.html