How to install MySQLdb on Mountain Lion

前端 未结 4 1728
粉色の甜心
粉色の甜心 2021-01-02 07:19

I\'m new to Python and I\'m having trouble building MySQLdb, in an attempt to get Google AppEngine SDK running. I have just upgraded from Snow Leopard to Mountain Lion and h

相关标签:
4条回答
  • 2021-01-02 07:46

    I finally found it says in the ReadMe to edit site.cfg and put the location of mysql_config in there.

    0 讨论(0)
  • 2021-01-02 08:01

    It seems that the system is complaining about not be able to find clang, which is included in Command Line Tools of Xcode. Did you installed the tool as well?

    Can be installed via

    • Open Xcode
    • Preference (Command + ,)
    • Components under the Download tab
    0 讨论(0)
  • 2021-01-02 08:05

    If someone is interested in a quick and easy way for Mac OS X 10.8:

    I assume you have XCode, it's command line tool, Python and MySQL installed.

    1. Install PIP:

      sudo easy_install pip
      
    2. Edit ~/.profile:

      nano ~/.profile
      

      Copy and paste the following two line

      export PATH=/usr/local/mysql/bin:$PATH
      export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
      

      Save and exit. Afterwords execute the following command

      source  ~/.profile
      
    3. Install MySQLdb

      sudo pip install MySQL-python
      

      To test if everything works fine just try

      python -c "import MySQLdb"
      

    It worked like a charm for me. I hope it helps.

    0 讨论(0)
  • 2021-01-02 08:06

    It seems that is not the only thing that you need to do, i check about the cc compiler that is not recognizing, and is not directing to the right file, googling i found that i need to change some files to found it before building, does not stop there, now that its recognizing is not charging the DYDL Libraries... it has been really hard to find a real answer just to start working with python.

    0 讨论(0)
提交回复
热议问题