I also got this error recently when using Anaconda on a Mac machine.
Here is what I found:
python3 -m pip install PyMySql,
pymysql module is under /Library/Python/3.7/site-packages
/opt/anaconda3/lib/python3.8/site-packages
Therefore, after copying pymysql module to the designated path, it runs correctly.