2

I'm trying to run a django server that connects to a database.

But I can't install mysqlclient using pip, it keeps telling me to install Visual C++ 14.0. I downloaded the Microsoft Visual Build tools including C++, yet I still get the same error.

ERROR: Command errored out with exit status 1:
 command: 'c:\users\user\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-hncaajb5\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-hncaajb5\\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\user\AppData\Local\Temp\pip-record-6ma5l3db\install-record.txt' --single-version-externally-managed --compile
     cwd: C:\Users\user\AppData\Local\Temp\pip-install-hncaajb5\mysqlclient\
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------

Can someone help please?

Pakochu
  • 81
  • 1
  • 1
  • 4
  • Does this answer your question? [Installing mysqlclient in Python 3.6 in windows](https://stackoverflow.com/questions/51146117/installing-mysqlclient-in-python-3-6-in-windows) – Edoardo Facchinelli Nov 28 '19 at 03:26
  • @uneven_mark pretty sure I installed it correctly, used the visual studio installer to download it and rebooted my PC when it asked me to, it says it's installed but I still get the error – Pakochu Nov 28 '19 at 04:05
  • @EdoardoFacchinelli I tried that before but couldn't get the wheels to work, something about it not being supported – Pakochu Nov 28 '19 at 04:05
  • When I had to do it last time I had to make sure the exact python and bit version matched or it won't be able to run, could you copy the error message? – Edoardo Facchinelli Nov 28 '19 at 04:07
  • @EdoardoFacchinelli ERROR: mysqlclient-1.4.6-cp38-cp38-win_amd64.whl is not a supported wheel on this platform. I'm using python 3.8 and windows 64. – Pakochu Nov 28 '19 at 05:19
  • According to the error message you posted in the question originally, python 3.7 32 bit was running. It may be that you have more than one version installed and PATH is not configured properly to run 3.8 64 bit. – Edoardo Facchinelli Nov 28 '19 at 10:28

0 Answers0