I have installed mysql apparently well, this is what I wrote in the terminal:
pip install mysql
and this was the result:
Collecting mysql
Using cached mysql-0.0.3-py3-none-any.whl.metadata (746 bytes)
Requirement already satisfied: mysqlclient in c:python312libsite-packages (from mysql) (2.2.4)
Using cached mysql-0.0.3-py3-none-any.whl (1.2 kB)
Installing collected packages: mysql
Successfully installed mysql-0.0.3
but after that, when I import the library i have the error: Import “mysql” could not be resolved. I don’t know how to fix it. I had a lot of problems with vscode.
3
According to PyPi:
This package is a ‘virtual package’, which requires MySQL-python (Python 2) or mysqlclient (Python 3) to install. In effect, this means ‘pip install mysql’ will actually install MySQL-python. Instead of depending on this package, please depend on the relevant package directly.
Since you’re using Python 3.12, what you need is mysqlclient. To install, run
pip install mysqlclient