gpt4 book ai didi

python - RaspberryPi-MySQLdb

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

Stackoverflow 用户您好,

对于我的学生项目,我需要使用 python 和 mysql,但是当我尝试使用时出现这种错误

Traceback (most recent call last): File "myRFIDserv.py", line 2, in import MySQLdb ImportError: No module named MySQLdb

我尝试通过安装 python-mysqldb 来解决这个问题,但他们也有一个错误......

Package python-mysqldb is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python-mysqldb' has no installation candidate

MySQL服务器已经安装!

我尝试过 sudo pip install MySQL-python 但出现这种错误

Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-lbb0Fd/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lbb0Fd/MySQL-python

我不明白,有人可以帮助我吗? ;)

最佳答案

也许你可以尝试

pip install MySQL-python

关于python - RaspberryPi-MySQLdb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30565530/

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