Python's MySQLdb can’t find libmysqlclient.dylib with Homebrewed MySQL

后端 未结 4 1011
梦谈多话
梦谈多话 2020-12-23 22:24

MySQL and Python installed with Homebrew

I installed MySQL and Python with Homebrew on OS X 10.10.5 Yosemite. My Python 2.7 is at python -> ../Cellar/pyth

4条回答
  •  暖寄归人
    2020-12-23 23:02

    You need to use dev version of mysqlclient:

    pip install git+https://github.com/PyMySQL/mysqlclient-python.git@master
    

    Before I had the lastest PyPI version (1.3.7) on Python 3.4 and it was searching for libmysqlclient.18.dylib (from MySQL 5.6) whereas I had only libmysqlclient.20.dylib(from MySQL 5.7).

    If you use Python 3, MySQL-python is not an option (and mysqlclient is its newer version).

提交回复
热议问题