python2.7.9 Installing the Mysql-python module

Source: Internet
Author: User

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

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.