No module named 'pymysql'

troyz picture troyz · Oct 31, 2015 · Viewed 140.2k times · Source

I'm trying to use PyMySQL on Ubuntu.

I've installed pymysql using both pip and pip3 but every time I use import pymysql, it returns ImportError: No module named 'pymysql'

I'm using Ubuntu 15.10 64-bit and Python 3.5.

The same .py works on Windows with Python 3.5, but not on Ubuntu.

Answer

user530873 picture user530873 · Oct 31, 2015

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