For safety's sake cp /etc/apt/source.list /etc/apt/source.list.bak
The following is the source of Ubuntu 14.04, (please find the source of other versions by yourself) 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
sudo apt-get update
sudo apt-get install mysql-python
Found an error:
sh: mysql_config: not found
Traceback (most recent call last):
File "setup.py", line 15, in
metadata, options = get_config()
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
The solution found on the Internet generally means that you don't have libmysqld-dev or libmysqlclient-dev, but they all exist after checking.
After that, I continued to install mysql-python and found that it still didn't work.
The miracle finally appeared:
Recommended Posts