I\'m trying to use PyMySQL on Ubuntu.
I\'ve installed pymysql using both pip and pip3 but every time I use import pymysq
Make sure that you're working with the version of Python that think you are. Within Python run import sys and print(sys.version).
Select the correct package manager to install pymysql with:
sudo pip install pymysql.sudo pip3 install pymysql.sudo conda install pymysql.sudo apt-get install pymysql.If all else fails, install the package directly:
sudo python3 setup.py install.This answer is a compilation of suggestions. Apart from the other ones proposed here, thanks to the comment by @cmaher on this related thread.