The system version I am using is: sles12-sp2
Using Python to connect to MySQL database requires installing the Mysql-python module;
1. First install PIP:
Download get-pipe.py from the official Python website and execute this script to install (or upgrade) automatically
2. Execute the command:
Pip Install Mysql-python
Error:
_mysql.c:29:20:fatal error:python.h:no such file or directory
#include "Python.h"
^
Compilation terminated.
Error:command ' gcc ' failed with exit status 1
is because Python-devel is not installed in this package;
SUSE ENTERPRISE 2 system comes with Python version is 2.7.9, find the appropriate version of the trouble, to the online search for a day, there is no result;
Finally found at this address:
https://ftp.internet.de/pub/linux/suse/sdk12sp2/suse/x86_64/
Download: python-devel-2.7.9-24.2.x86_64.rpm
Install it, and then re-execute pip install Mysql-python on ok!
python2.7.9 Installing the Mysql-python module