i have Ubuntu and installed python3 since my script is written in it. Since I use MYSQL with MySQLdb, I installed
apt-get install python-mysqldb
however this installed MySQLdb to Python (which is 2.6 on Ubuntu) and not to Python3.
Sorry, I have just started working with Python today...
1- You can use this command
sudo apt-get install python3-mysqldb
It worked for me.
2- also you can install pip install PyMySQL
.
__init__.py
file# __init__.py file
import pymysql
pymysql.install_as_MySQLdb()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With