Home  >  Q&A  >  body text

mysqldb - MAC OS安装MySQL-python总是失败,请帮忙看看什么原因?

Python版本:Python 2.7.10 (default, Jul 30 2016, 19:40:32)
问题截图如下:

截图1:未使用管理员权限安装。

截图2:使用管理员权限安装。

试过:
方法一:https://segmentfault.com/q/10...
不知道文中提到的“mysql-python可能没找到正确的配置”是什么意思,最终还是没有解决。

方法二:https://segmentfault.com/q/10...
安装了“Xcode 的 Command Line Tools”结果还是一样。

方法三:https://segmentfault.com/q/10...
在Windows上我已经安装成功,但是MAC上问题依旧。同样也使用了PyCharm的包管理器安装,还是一样不行。

方法四:https://segmentfault.com/q/10...
和我的报错不同,但我还是试了他的方法,输入了命令“xcode-select --install”安装之后,问题还是一样。

……

新手太新,无力自救,求助大神。

天蓬老师天蓬老师2741 days ago575

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:32:01

    The error message mysql_config not find means that the configuration file was not found. What is your Python version? Python 3.0 or above installs pymysql, and version 2.7 installs MySQLdb. You can find and install it according to the version

    reply
    0
  • PHPz

    PHPz2017-04-18 10:32:01

    Try sudo pip install mysql-python

    Has mysql been installed?

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:32:01

    Method 1:
    1: Install mysql, brew install mysql
    2: And configure the environment variable export PATH=$PATH:/usr/local/mysql/bin
    3: Install mysql-python pip install MySQL-Python

    Method 2:

    1: Install python-dev and libmysqlclient-dev

    2: Install mysql-python

    Personally, I don’t really like to install mysql for mysql-python

    reply
    0
  • 迷茫

    迷茫2017-04-18 10:32:01

    Brew install mysql is enough, but there is no mysql environment

    reply
    0
  • Cancelreply