Django安装mysqlclient报错解决!!!

参考链接:
https://pypi.org/project/mysqlclient/

仔细看pypi mysqlclient 官网!!!!!!!!!!

第一步:
Install
Prerequisites
You may need to install the Python and MySQL development headers and libraries like so:
sudo apt-get install python-dev default-libmysqlclient-dev # Debian / Ubuntu
sudo yum install python-devel mysql-devel # Red Hat / CentOS

brew install mysql-client # macOS (Homebrew)
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.

第二步:
Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command :
sudo apt-get install python3-dev # debian / Ubuntu
sudo yum install python3-devel # Red Hat / CentOS

第三步:(成功)
Install from PyPI
pip install mysqlclient

你可能感兴趣的:(python)