This article describes how Python installs Mysql-python. Share to everyone for your reference, as follows:
Actions performed under Ubuntu system
The PIP tool is installed first
sudo apt-get install Python-pip
Then use
sudo pip install Mysql-python
Install a third-party library. But this error
Sh:mysql_config:not Foundtraceback (most recent): File ' setup.py ', line ' in
metadata, Options ' = Get_config () File "/home/zhxia/apps/source/mysql-python-1.2.3/setup_posix.py", line +, in get_config libs = Mysql_config ("Libs_r") File "/home/zhxia/apps/source/mysql-python-1.2.3/setup_posix.py", line, in Mysql_config raise EnvironmentError ('%s not found '% (Mysql_config.path,)) Environmenterror:mysql_config not found
The reason is that there is no installation: Libmysqlclient-dev
sudo apt-get install Libmysqlclient-dev
Continue installation Discovery or error
mysql.c:29:20:fatal error:python.h: There is no file or directory, the Python header file cannot be found, does wheezy not install the Python development package by default?
sudo dpkg-l | grep Python-dev
Sure enough, there really is a need to install:
sudo apt-get install Python-dev
The Mysql-python can be compiled and passed.
More interested in Python related content readers can view this site topic: "Python Picture Operation skills Summary", "Python data structure and algorithm tutorial", "Python Socket Programming Skills Summary", "Python function Use Tips", " Python string manipulation Tips Summary, Python Introductory and Advanced classic tutorials, and Python file and directory operations tips
I hope this article is helpful for Python program design.