gpt4 book ai didi

python - 没有名为 mysql 的模块; _mysql 在哪里

转载 作者:行者123 更新时间:2023-11-29 06:22:38 28 4
gpt4 key购买 nike

import MySQLdb

回溯:

Traceback (most recent call last):
File "D:\zjm_code\sphinx_test\a.py", line 1, in <module>
import MySQLdb
File "D:\zjm_code\sphinx_test\MySQLdb\__init__.py", line 19, in <module>
import _mysql
ImportError: No module named _mysql

最佳答案

您需要正确安装MySQLdb。它由 python 模块和平台相关的库(在您的情况下为 _mysql.dll )组成。使用项目页面中的 win32 安装程序,而不是仅通过解压源进行安装。

关于python - 没有名为 mysql 的模块; _mysql 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2171078/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com