I already install pymysql in my python terminal but when I import it on my jupyter it says - ModuleNotFoundError: No module named 'pymysql'

Viewed 18

I already install pymysql by

pip3 install pymysql

enter image description here

In my jupyter it says module not found

import os
import pymysql
import pandas as pd

host = os.getenv('MYSQL_HOST')
port = os.getenv('MYSQL_PORT')
user = os.getenv('MYSQL_USER')
password = os.getenv('MYSQL_PASSWORD')
database = os.getenv('MYSQL_DATABASE')

conn = pymysql.connect(
    host=host,
    port=int(3306),
    user="root",
    passwd=*****A,
    db="[sql_store]",
    charset='utf8mb4')

df = pd.read_sql_query("SELECT * FROM YOUR_TABLE",
    conn)
df.tail(10)

This is the screenshot from my PyCharm terminal and jupyter notebook

enter image description here

0 Answers
Related