I have a Python script 'test.py' which has import pymysql. I have installed pymysql using pip and sudo. When I run this .py, it works great.
I have another Bash script which is used to run the above test.py. When I run this bash script, I get the error:

ModuleNotFoundError: No module named 'pymysql'

Where am I going wrong?
PyMySQL==0.9.3
Python=3.7.1
It is possible that pymysql's location needs to be in your PATH environment variable. 
When you run your bash script, what version of python is it using? Is it using the python "on which" you installed pymysql, or another one?
To make sure you are using the correct version of Python, I suggest using venv.
ModuleNotFound error while running through Bash