Install python MySQLdb module under linux

MySQLdb download address

https://github.com/farcepest/moist

The installation process is as follows

$ tar zxvf downloaded file

$ python setup.py build

$ python setup.py install

Install the setuptool tool

https://pypi.python.org/packages/source/s/setuptools

$ tar zxvf downloaded file

$ python setup.py build

$ python setup.py install

 

The following problems may occur:

one,

This is because the development package of mysql is not installed, execute the following command to install:

$ sudo apt-get install libmysqlclient-dev

Question two:

This is because the python development package is not installed, execute the following command to install:

$ sudo apt-get install python-dev

Supplementary note, MySQLdb does not support python3 installation

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327034464&siteId=291194637