gpt4 book ai didi

python - 你如何为 Flask 安装 MySQL?

转载 作者:太空宇宙 更新时间:2023-11-03 11:36:23 24 4
gpt4 key购买 nike

<分区>

我正在使用 OS X Yosemite、Python 3.6.2,并且基本上浏览了每一个关于将 MySQL 安装到 flask 的 stackoverflow 帖子。

我试过 pip install flask-mysqlDB ,但出现了错误

Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz
Requirement already satisfied: Flask>=0.10 in ./venv/lib/python3.6/site-packages (from flask-mysqldb)
Collecting mysqlclient (from flask-mysqldb)
Using cached mysqlclient-1.3.10.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-32rvmlzy/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-32rvmlzy/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-32rvmlzy/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 /private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-32rvmlzy/mysqlclient/

由于我的 Mac 版本,所有 sudo apt-get 命令都不起作用。通过 brew install python 安装了 homebrew,我仍然无法使用 sudo apt-get 命令。

我的点数列表是

click (6.7)
Flask (0.12.2)
itsdangerous (0.24)
Jinja2 (2.9.6)
MarkupSafe (1.0)
mysql-connector-python-rf (2.2.2)
mysqlclient (1.3.10)
pip (9.0.1)
setuptools (28.8.0)
virtualenv (15.1.0)
Werkzeug (0.12.2)

现在我有一个错误说:

Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-n8on2g_t/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-n8on2g_t/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/c4/y49xcq6j6jlcr_8yyckm75th0000gp/T/pip-build-n8on2g_t/MySQL-python/

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