search

Home  >  Q&A  >  body text

python - Mac 安装 MySQLdb时 报错,所有过程都按照网上说的做的,还是报错,求大神帮助

高洛峰高洛峰2875 days ago522

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-18 10:30:26

    python3 使用 pymysql

    pip install pymysql

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:30:26

    The problem with my Python2.7 when installing MySQLdb is because I don’t have MySQL on my machine. I finally installed it brew install mysql, but the error seems to be different from yours... You can try it

    reply
    0
  • 迷茫

    迷茫2017-04-18 10:30:26

    *
    nano ~/.profile
    Write the following content

    export PATH=/usr/local/mysql/bin:$PATH
    export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
    Save and exit, here I am ctrl + O (save), then Enter (very important), ctrl + X (exit), this editor is such a pain in the ass

    Execute code

    source ~/.profile

    • Install MySQLdb

    1. pip2 install MySQL-python

    nano ~/.profile
    source ~/.profile
    pip install mysqlclient

    reply
    0
  • Cancelreply