Installing MySQLdb on Mac OS X

前端 未结 4 861
醉酒成梦
醉酒成梦 2020-12-15 10:39

I\'ve spent several hours trying to install MySQLdb (the Python library) on Mac OS X Snow Leopard. I\'m using these instructions from SO. I keep getting an error, so I\'ve t

相关标签:
4条回答
  • 2020-12-15 11:09

    sudo pip install mysql-python worked for me in 10.8.1.

    0 讨论(0)
  • 2020-12-15 11:23

    You can also force python to run in 32bit mode:

    defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
    
    0 讨论(0)
  • 2020-12-15 11:28

    try this in .bashrc or .bash_profile

    PATH="/usr/local/mysql/bin:${PATH}"
    export PATH
    export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
    export VERSIONER_PYTHON_PREFER_64_BIT=no
    export VERSIONER_PYTHON_PREFER_32_BIT=yes
    
    0 讨论(0)
  • 2020-12-15 11:31

    Ack. I feel your pain. I spent a really long time also trying to get MySQL working with Python 2.6 on Snow Leopard using a Macbook Air and had lots of architecture problems. What ended up solving it for me, was making sure both my Python and MySQL installations were using a 32 bit architecture like my Snow Leopard was.

    I wrote about my solution here, so maybe that'll help:

    http://www.markliu.me/2010/jun/09/mysql-and-python-on-32-bit-snow-leopard/

    Good luck...

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