PyCharm导入pymysql包运行报错问题解决:No module named 'PyMySQL'
import pymysql # 导入包
# 报错问题显示: ImportError: No module named ‘PyMySQL‘
出现该问题提示:找不到该包名。
解决办法如下:
①先下载PyMySQL包,在终端执行命令:
sudo pip install PyMySQL
②pip下PyMySQL如下:
pip install PyMySQL
Requirement already satisfied (use --upgrade to upgrade): PyMySQL in /usr/local/lib/python2.7/dist-packages
③导入安装:
sudo apt-get install python3-pymysql
安装完成即可导入~
import PyMySQL
print("Here")
文章来自:https://www.cnblogs.com/qingchang/p/8986310.html