import mysql.connector
mydb = mysql.connector.connect(host='localhost', user='root',passwd='password', auth_plugin='mysql_native_password')
I am doing same thing in Jupyter notebook, it is working there but in VScode it shows:
ModuleNotFoundError: No module named 'mysql'
All other package I install work fine but having trouble only with this.
I have installed using pip. Any solution for this?
Of course I could work with Jupyter notebook but I like vscode more so ....
Python 3.8.3
pip 20.2.3
Regards,
I faced the same error when I'm using Pycharm. Installing other packages works for me. You could try and install this and try running if it solves your problem.
pip install mysql-connector-python-rf
Another solution would be restarting your local IDE which is VScode. I used VScode as my main IDE and installing some modules in python makes it raised an error like ModuleNotFound
. Restarting it solved the problem.