1、 Questions
Today, when using the Sqlalchemy Library of flash to configure and connect to MySQL, we encountered a small problem, that is, when all package environments are correctly compiled, the access to debug fails. The exception is as follows:
ImportError: No module named MySQLdb
2、 Solutions
-
There are always some wonderful things in Windows environment. It’s easy to do in Ubuntu. Use the following code directly:
$sudo apt-get install python-mysqldb
-
Then windows needs some means to install Microsoft Visual C + + compiler for Python 2.7. The link is as follows
==Microsoft Visual C++ Compiler for Python 2.7==
-
Then we use this command to execute it on the command line
python -m pip install MySQL-python
-
The following error occurs:
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
-
After a search, we found that we still need to install this driver. The link is as follows
===============MySQL-python===============
-
So far, the amazing discovery environment is OK