gpt4 book ai didi

python - Ubuntu 17 : Can't install mysqlclient

转载 作者:行者123 更新时间:2023-11-28 21:39:02 28 4
gpt4 key购买 nike

尝试按照 Django 教程进行操作,但我无法安装 mysqlclient

教程声称我可以使用以下命令执行此操作:

pip install mysqlclient

但这会产生这个错误:

Collecting mysqlclient   Using cached mysqlclient-1.3.12.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-rrolctwh/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-rrolctwh/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-rrolctwh/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found


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

我安装了最新的 pip 和 virtualenv。

我希望能够安装 mysqlclient 以便我可以继续本教程。

最佳答案

您还应该安装 mysql 和 python 开发头文件和库: https://github.com/PyMySQL/mysqlclient-python#prerequisites

关于python - Ubuntu 17 : Can't install mysqlclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47370385/

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