ModuleNotFoundError: No module named 'pymysql' in jupyter

Viewed 7558

I am getting below error after importing pymysql in jupyter notebook. Please help me to find error.

import pymysql
print("Welcome")

ModuleNotFoundError  
 <ipython-input-5-7978bc79cc40> in <module>()
  1 import pymysql
  2 print("Here")

 ModuleNotFoundError: No module named 'pymysql'
3 Answers

You have not installed the module pymysql Try :

python -m pip install pymysql

Or

python3 -m pip install pymysql

for python3.

It appears that pymsql is not installed in your python environment you are working on.

Please type below command in a cell in jupyter notebook, then run the cell.

 !pip install pymysql

This should resolve your problem.

Related