Importerror:no module named MySQLdb

Source: Internet
Author: User

When you run a Python app

File "D:\myproject\testhzq\1\site-packages\flask\app.py", line 1475, in full_dispatch_request RV = Self.dispatch_reque St () File "D:\myproject\testhzq\1\site-packages\flask\app.py", line 1461, in Dispatch_request return self.view_functio  Ns[rule.endpoint] (**req.view_args) file "D:\myproject\testhzq\1\app\views.py", line A, in index Db.create_all () file "D:\myproject\testhzq\1\site-packages\flask_sqlalchemy\__init__.py", line 895, in Create_all Self._execute_for_all_ Tables (app, bind, ' Create_all ') File "D:\myproject\testhzq\1\site-packages\flask_sqlalchemy\__init__.py", line 887, In _execute_for_all_tables op (bind=self.get_engine (app, bind), **extra) File "D:\myproject\testhzq\1\site-packages\ flask_sqlalchemy\__init__.py ", line 833, in Get_engine return Connector.get_engine () File" D:\myproject\testhzq\1\site -packages\flask_sqlalchemy\__init__.py ", line 499, in get_engine self._engine = RV = Sqlalchemy.create_engine (info, **o ptions) File "D:\myproject\testhzq\1\site-packages\sqlalchemy\engine\__init__.py ", line 338, in Create_engine return Strategy.create (*args, **kwargs) Fil E "D:\myproject\testhzq\1\site-packages\sqlalchemy\engine\strategies.py", line +, in Create Dbapi = Dialect_cls.dbapi  (**dbapi_args) File "D:\myproject\testhzq\1\site-packages\sqlalchemy\connectors\mysqldb.py", line Dbapi return __import__ (' MySQLdb ') Importerror:no module named MySQLdb

Discover the need to install Mysql-python
Enter PIP Install Mysql-python

But installation is unsuccessful, ' unable to find Vcvarsall.bat ', need to install VC + +

Find the answer on Stack overflow (http://stackoverflow.com/questions/2272786/python-issueunable-to-find-vcvarsall-bat)
This is a lot of people have encountered the problem, specifically someone did plug-ins, according to the use of Win32 + Python 2.7 now corresponds to the version of the plugin,
The first installation, the results run an error, '--mysql ' is 1.2.4 and I installed the MYSQLDB is 1.2.3
Find the right version of this website (http://sourceforge.net/projects/mysql-python/?source=typ_redirect)
Because python inside a variety of libraries, plug-in updates faster, there may be no existing version, it is necessary to figure out the principle of this plug-in production, get one yourself,
Stack overflow has links above and gives the method.


Importerror:no module named MySQLdb

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.