It's likely you're getting the error in Visual Studio Code because you're using a virtual environment in PyCharm.
The PyCharm error is the error you should be focusing on.
What imports are you using for this project? The error seems to be caused by an unsupported library, I am unsure if this is from your script or a script from the mysql-connector library.
Have you tried reinstalling mysql-connector with both python -m pip uninstall mysql-connector
and python -m pip install mysql-connector
?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…