gpt4 book ai didi

python - 安装 MySQL-python 1.2.5 时出现 "python setup.py egg_info"错误

转载 作者:行者123 更新时间:2023-11-29 17:31:07 25 4
gpt4 key购买 nike

我正在运行 MacOS High Sierra 10.13.2 (17C88) 的 Mac 上工作。在我的 virtualenv 中安装 mysql 时出现以下错误:

Collecting MySQL-python==1.2.5 (from -r qs4bmg/requirements/common.txt (line 4))
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/dx/hgccddq94qs8ww9ly3ykr0y40000gn/T/pip-install-guSoBx/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 /private/var/folders/dx/hgccddq94qs8ww9ly3ykr0y40000gn/T/pip-install-guSoBx/MySQL-python/

我尝试了很多解决方案( this 是最流行的一个,但使用的是 apt 而不是 pip),但没有成功。您能帮我解决这个错误吗?

最佳答案

终于找到解决办法了。

  1. 更新 xcode
  2. $sudo xcodebuild -license 接受

  3. $brew 卸载 mysql-connector-c

  4. $brew 安装 mysql

  5. $pip install mysqlclient

关于python - 安装 MySQL-python 1.2.5 时出现 "python setup.py egg_info"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50647919/

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