Python installation Mysql-python Concise notes (Ubuntu Environment)

Source: Internet
Author: User
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.

  • Related Article

    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.