No module named 'pymysql' No module named 'pymysql' python-3.x python-3.x

No module named 'pymysql'


Sort of already answered this in the comments, but just so this question has an answer, the problem was resolved through running:

sudo apt-get install python3-pymysql


Use:

import pymysql

Not:

import PyMySQL

That works for me.


After trying a few things, and coming across PyMySQL Github, this worked:

sudo pip install PyMySQL

And to import use:

import pymysql