Mac above install Mysql-python

Source: Internet
Author: User

The installation process has been error:

Environmenterror:mysql_config not found

Finally, the following approach is resolved:


58down voteaccepted+200

Ok, well, first A, let me check if I am on the same page as you:

    • You installed Python
    • You didbrew install mysql
    • You didexport PATH=$PATH:/usr/local/mysql/bin
    • And finally, you didpip install MySQL-Python

If you do all those steps in the same order, and you still got an error, read the end, if, however, do not fol Low these exact steps try, following them from the very beginning.

So, you followed the steps, and your ' re still geting an error, well, there is a few things you could try:

  1. Try running from which mysql-config bash. It probably won ' t be found. That's why the build isn ' t finding it either. Try running and see locate mysql-config if anything comes back. The path to this binary needs to being either in your shell's $PATH environment variable, or it needs to being explicitly in the setup.py file for the module assuming it's looking in some specific place for that file.

  2. Instead of using Mysql-python, try using ' Mysql-connector-python ', it can be installed using pip install mysql-connector-python . More information on this can is found here andhere.

  3. Manually find the location of ' mysql/bin ', ' mysql_config ', and ' Mysql-python ', and add all these to the $PATH environment Variable.

  4. If all above steps fail and then you could try installing ' MySQL ' using macports with which case the file ' Mysql_config ' would Actually is called ' Mysql_config5 ', and in the this case, you would has to do this after installing: export PATH=$PATH:/opt/local/lib/mysql5/bin . You can find more details here.

Note1:i ' ve seen some people saying that installing python-dev libmysqlclient-dev and also helped, however I does not know if these packages a Re available on Mac OS.

Note2:also, make sure to try running the commands as root.

I got my answers from (besides my brain) these places (maybe you could has a look at them, to see if it would help): 1, 2 , 3, 4.

I hoped I helped, and would is happy to know if any of the this worked, or not. Good luck.

Mac above install Mysql-python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.