python setup.py egg_info mysqlclient

前端 未结 9 1633
孤独总比滥情好
孤独总比滥情好 2020-12-05 01:05

Trying to install mysqlclient using pip3 on Python 3.6.0

$ pip3 install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.10.tar.gz
    Comp         


        
相关标签:
9条回答
  • 2020-12-05 01:39

    This worked for me on MacOS 10+. Rather than directly installing mysqlclient using pip, use this command first

    brew install mysql
    

    If you do not have an existing setup for brew, then install brew from it's homepage

    Then run

    pip install mysqlclient
    

    This should work! Also ensure you have a virtualenv set up for your projects, as it is among good practices to maintain venv's for each project seperately.

    0 讨论(0)
  • 2020-12-05 01:42

    Came across this while developing a django-based website, and I needed to set up the website to communicate with a mysql database. I've not used homebrew to do any of my installations.

    Since I'm doing the development on a MacOS with Anaconda installed, I discovered that there was an issue with Anaconda. Without knowing the details, I was able to install mysqlclient with conda install mysqlclient

    Hope that helps someone else with this problem as well.

    0 讨论(0)
  • Other options didn't work for me, but this worked for me:

    For Python3:

    env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip3 install mysqlclient

    For Python2:

    env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip2 install mysqlclient

    or

    env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install mysqlclient

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