i am new in Django.i want to use Mysql database for my project.i am installing mysqlclient for that, but its showing below error. i am using --pip install mysql-python command for installing mysqlclient
Collecting mysql-python Using cached MySQL-python-1.2.5.zip (108 kB) Using legacy setup.py install for mysql-python, since package 'wheel' is not installed. Installing collected packages: mysql-python
Running setup.py install for mysql-python ... error
ERROR: Command errored out with exit status 1:
command: 'f:\xampp\htdocs\django\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ti26jpbi\\mysql-python\\setup.py'"'"';
__file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ti26jpbi\\mysql-python\\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\DELL\AppData\Local\Temp\pip-record-h90u4076\install-record.txt'
--single-version-externally-managed --compile --install-headers 'f:\xampp\htdocs\django\include\site\python3.8\mysql-python'
cwd: C:\Users\DELL\AppData\Local\Temp\pip-install-ti26jpbi\mysql-python\
Complete output (24 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying _mysql_exceptions.py -> build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
---------------------------------------- ERROR: Command errored out with exit status 1: 'f:\xampp\htdocs\django\scripts\python.exe' -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ti26jpbi\\mysql-python\\setup.py'"'"';
__file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-ti26jpbi\\mysql-python\\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\DELL\AppData\Local\Temp\pip-record-h90u4076\install-record.txt'
--single-version-externally-managed --compile --install-headers 'f:\xampp\htdocs\django\include\site\python3.8\mysql-python' Check the logs for full command output.
i an using windows 10. i appreciate if anyone can help me with this error.
MySQL-pythononly supports Python 2. Usepip install mysqlclientto install mysqlclient. Make sure you have 64-bit Python installed - that way it will install the wheel.mysqlclientbut it won't be the same, so please show that error instead. As I said before the easiest solution is to switch to 64-bit Python then you won't have to buildmysqlclient.