Installing MySQL Python on Mac OS X

后端 未结 15 1916
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 03:02

Long story short, when I write the following:

sudo easy_install MySQL-python

I get the error

EnvironmentError: mysql

相关标签:
15条回答
  • 2020-11-27 03:58

    Above all, I can't solve it. But I add file to /usr/local/include solve it.

    https://github.com/peterlee0304/MySQL-Python/blob/master/my_config.h

    In /usr/local/include, add a my_config.h file.

    Then pip install MySQL-Python

    Solve it!

    0 讨论(0)
  • 2020-11-27 04:01

    As others mentioned before me....getting Python to work with MySQL on a Mac is a ?@#$@&%^!! nightmare.

    Installed Django framework on Mac OS 10.7.5 initially from the original Django website and when the MySQLdb didn't work, and after many hours googling and trying solutions from SO, I have installed the Django stack from BitNami http://bitnami.com/stack/django

    Still, got the issues mentioned above and then some more...

    What helped me eventually is what Josh recommends on his blog: http://joshbranchaud.com/blog/2013/02/10/Errors-While-Setting-Up-Django.html

    Now Python 2.7 is finally connected to MySQL 5.5

    0 讨论(0)
  • 2020-11-27 04:02

    the below may be help.

    brew install mysql-connector-c
    CFLAGS =-I/usr/local/Cellar/mysql-connector-c/6.1.11/include pip install MySQL-python
    brew unlink mysql-connector-c
    
    0 讨论(0)
提交回复
热议问题