Ubuntu Installation Mysql-python

Source: Internet
Author: User


1. First you need to make sure that the Ubuntu update source is available. The following source is suitable for 13. X and 14.X, the low version of Ubuntu has not been tried. After all, labor is not a test worker.

For security reasons Cp/etc/apt/source.list/etc/apt/source.list.bak

Write the following to/etc/apt/source.list

Deb Http://mirrors.163.com/ubuntu/trusty main restricted universe multiverse
deb Http://mirrors.163.com/ubuntu/trusty-security main restricted universe multiverse
deb Http://mirrors.163.com/ubuntu/trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/trusty-proposed main restricted universe multiverse
deb Http://mirrors.163.com/ubuntu/trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/trusty-backports main restricted universe multiverse

2. sudo apt-get update

3.sudo Apt-get Install Mysql-python

Found an error:

Sh:mysql_config:not found
Traceback (most recent):
File "setup.py", line <module>
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


4. The detailed reason is that the Setup program cannot find the Mysql_config file under/usr/bin/.

The solution on the web is usually to say you have no libmysqld-dev or Libmysqlclient-dev. But there's a look.


5. First an important python-dev is not normally installed, so sudo apt-get install is required Python-dev

Continue to install Mysql-python, found or not.

6. Re-install the Libmysqlclient-dev,

The miracle finally appeared:


Ubuntu Installation Mysql-python

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.