python3 install MySQL-python

If you plan to interact with python and MySQL database, of course, need to install MySQL-python of third-party libraries. If the direct use pip install, usually it reported an error: python.h not find, because there are some dependencies not loaded.

Install dependencies (Ubuntu only): apt-get install libmysqlclient-dev libmysqld-dev python-dev python-setuptools.

After installing MySQL-python: pip install MySQL-python.

 

Correction: The above major support python2, MySQL-python is not supported python3, if you want to use MySQL python3 in the python interface, you need to install another set of methods.

sudo apt-get install python3-dev libmysqlclient-dev

pip install mysqlclient。

This library is also very easy to use, effective pro-test.
----------------
Disclaimer: This article is the original article CSDN bloggers "qiweiqian", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/qiweiqian/article/details/79692891

Guess you like

Origin www.cnblogs.com/chengfengchi/p/12157661.html