I am encountering an issue with a ModuleNotFoundError when trying to import the mysql.connector module in my Python script. I have already installed the module using pip install mysql-connector-python, but I still can't seem to resolve the error.
1.Checked Python version: 3.11.1
2.Executed pip show mysql-connector-python:
Name: mysql-connector-python
Version: 8.3.0
Summary: MySQL driver written in Python.
3.Checked virtual environment activation:
Virtual environment is activated.
4.Reinstalled MySQL Connector:
pip uninstall mysql-connector-python
pip install mysql-connector-python
pip --versionandpython --version, can you place how are you staring script? I didpip install mysql-connector-pythonandpython3 -c 'import mysql.connector'on clean system and it works finepython3 -m pip install mysql-connector-pythonto install it, then again itpython3 -c 'import mysql.connector'pip install mysql-connector-python, and it worked without any issues.