Import pymysql is getting error

use
import mysql.connector

example :

import mysql.connector

def conn():
return mysql.connector.connect(host=“localhost”,database=“python”,user=“root”,password=“password”,port=3306)

def createtable():
con=conn()
mycursor=con.cursor()
query=“create table student2(name varchar(10), clas int,rollno int primary key )”
mycursor.execute(query)
con.commit()
print(“table created”)
con.close()