0
我正在學習燒瓶開發&只是一個初學者。我正在嘗試使用flask-sqlalchemy ORM連接在mamp服務器上運行的mysql數據庫。但是,當我試圖運行該應用程序它拋出此錯誤:不能使用Flask-SqlAlchemy和mamp
ModuleNotFoundError: No module named 'MySQLdb'
經過很少的研究,我想我應該安裝mysqldb。然後我試圖運行這個命令:
pip install flask-mysqldb
,我看到一個新的錯誤&這裏是完整的跟蹤:
Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz
Requirement already satisfied: Flask>=0.10 in ./env/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/qy/81pz3q7n2l310x2r6nrjp9nr0000gn/T/pip-build-rdep43c8/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/qy/81pz3q7n2l310x2r6nrjp9nr0000gn/T/pip-build-rdep43c8/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/qy/81pz3q7n2l310x2r6nrjp9nr0000gn/T/pip-build-rdep43c8/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
我閱讀了有關這個問題,其中大部分引導更改配置一些文章在site.cfg上。但不幸的是,我找不到任何名爲site.cfg的文件。我閱讀了許多關於這個問題的文章,並試圖按照他們的指南,但沒有爲我工作。 不知道,但可能是我在做一些愚蠢的錯誤什麼的。有人請幫我擺脫這個...
感謝, 羅賓