import pymysql #import package
#Error reporting problem shows: ImportError: No module named ' PyMySQL '
The error message appears: The package name cannot be found.
The solution is as follows:
①Download the PyMySQL package first, and execute the command in the terminal:
sudo pip install PyMySQL
②PyMySQL under pip is as follows:
pip install PyMySQL
Requirement already satisfied (use --upgrade to upgrade): PyMySQL in /usr/local/lib/python2.7/dist-packages
③ Import and install:
sudo apt-get install python3-pymysql
After the installation is complete, you can import~
import PyMySQL
print("Here")