1

I am new in python and I'm trying to install flask_mysqldb from console. After attempting to install with PIP I'm getting this error:

Command "c:\users\\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\\\AppData\\Local\\Temp\\pip-install-u_90tj5p\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\\AppData\Local\Temp\pip-record-kdrtt5v6\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\\AppData\Local\Temp\pip-install-u_90tj5p\mysqlclient\

I have followed this one [Flask-MySQLdb’s documentation][1]

what is this error? and how to fix it?

a rolle
  • 13
  • 5

1 Answers1

0

following might be the reason for the failure.

1) incompatible python issue,so install python 64 bit version instead of python 32
or the other way and try to pip install again.

Abhishek D K
  • 2,257
  • 20
  • 28
  • Thank you! I have tried, and there is no improvement – a rolle Dec 04 '18 at 11:42
  • another way is to download the wheel file and do pip install https://www.lfd.uci.edu/~gohlke/pythonlibs/ – Abhishek D K Dec 04 '18 at 12:12
  • or try https://pypi.org/project/Flask-MySQLdb/#files . here is the similar issues posted https://stackoverflow.com/questions/47015590/python-how-to-run-flask-mysqldb-on-windows-machine – Abhishek D K Dec 04 '18 at 12:14
  • and even download mysqlclient from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient – Abhishek D K Dec 04 '18 at 12:18
  • Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools – Abhishek D K Dec 05 '18 at 06:09
  • and also the error is because of mysql_client , so install the different version first https://pypi.org/project/mysqlclient/1.3.12/#files – Abhishek D K Dec 05 '18 at 06:14
  • similar issue found here https://stackoverflow.com/questions/51146117/installing-mysqlclient-in-python-3-6-in-windows hope this will be helpful – Abhishek D K Dec 05 '18 at 06:29
  • glad to hear...which steps did u follow? – Abhishek D K Dec 06 '18 at 19:52
  • I reinstalled python 64, installaled visual studio code 64, then I installed windows SDK.[link](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk). then pip install MySQL, and pip install flask_mysqldb – a rolle Dec 07 '18 at 15:02