Install mysqlclient for Django Python on Mac OS X Sierra

前端 未结 6 2222
小蘑菇
小蘑菇 2020-12-02 23:55

I have already installed

  • Python 2.7.13
  • Django 1.11
  • MySQL 5.7.17

I want use MySQL with Django, but after install mysql connect

6条回答
  •  北海茫月
    2020-12-03 00:20

    I needed the following to build / install mysqlclient

    brew install mysql-client
    # mysql-client is not on the `PATH` by default
    export PATH="/usr/local/opt/mysql-client/bin:$PATH"
    # openssl is not on the link path by default
    export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
    

    Then I could pip wheel mysqlclient / pip install mysqlclient successfully

提交回复
热议问题