Home > Backend Development > Python Tutorial > Django reports that there is no module MySQLdb under Python 3.5.

Django reports that there is no module MySQLdb under Python 3.5.

怪我咯
Release: 2017-06-27 09:47:17
Original
1717 people have browsed it

Write the following code in the __init__.py file under the entire project site (that is, in the same file as setting.py):

import pymysql
pymysql.install_as_MySQLdb()
Copy after login

You need to install the pymysql module in advance , equivalent to the MySQLdb module in Python2.

will solve the problem.

The above is the detailed content of Django reports that there is no module MySQLdb under Python 3.5.. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template