ModuleNotFoundError - 用于 python 3 的 PyMySQL [英] ModuleNotFoundError - PyMySQL for python 3
问题描述
我正在尝试让一个简单的测试程序在我的机器上运行,该程序连接到 SQL 数据库.我pip安装然后卸载,然后用pip3安装:pymysql.我遇到的问题:
I am trying to get a simple test program working on my machine that connects to a SQL DB. I pip installed and then uninstalled and then installed with pip3: pymysql. the issue I'm getting:
导入 PyMySQLModuleNotFoundError: 没有名为PyMySQL"的模块.
import PyMySQL ModuleNotFoundError: No module named 'PyMySQL'.
运行pip list命令可以找到,运行程序时找不到.我正在仔细阅读其他 SO Q&A,但没有任何帮助.谢谢
it can be found when i run the command pip list, but not found when running the program itself. I was perusing over other SO Q&A's but nothing helped. Thanks
推荐答案
首先安装 PyMySQL 使用:
First insall PyMySQL using:
pip install PyMySQL
在python 3中是pymysql,全部小写
In python 3 it is pymysql, all in lower case
import pymysql
这篇关于ModuleNotFoundError - 用于 python 3 的 PyMySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!