Operations performed under the Buntu system
The PIP tool is installed first
| 1 |
sudoapt-get installpython-pip |
Then use
| 1 |
sudopip install mysql-python |
Install a third-party library. But this error
| 123456789 |
sh: mysql_config: not foundTraceback (most recent call last): File "setup.py", line 15, in <module> 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 reason is that there is no installation: Libmysqlclient-dev
| 1 |
sudoapt-get install libmysqlclient-dev |
Error: Import MySQLdb
Importerror:no module named MySQLdb
Installation: Apt-get Install PYTHON-MYSQLDB
If Python3, replace Python with Python3,pip and replace with PIP3 when installed above
Article reference: http://blog.sina.com.cn/s/blog_74a7e56e0101a7qy.html
Ubuntu16.04 installation MySQLdb