Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the error coming pip install MySQL-python

C:\Windows\system32>pip install MySQL-python 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: 'C:\Users\Pavan P\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python\setup.py'"'"'; file='"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\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\Pavan P\AppData\Local\Temp\pip-record-lt8udbbu\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Pavan P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\MySQL-python' cwd: C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python
Complete output (24 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 copying mysql_exceptions.py -> build\lib.win-amd64-3.8 creating build\lib.win-amd64-3.8\MySQLdb copying MySQLdb_init.py -> build\lib.win-amd64-3.8\MySQLdb copying MySQLdb\converters.py -> build\lib.win-amd64-3.8\MySQLdb copying MySQLdb\connections.py -> build\lib.win-amd64-3.8\MySQLdb copying MySQLdb\cursors.py -> build\lib.win-amd64-3.8\MySQLdb copying MySQLdb\release.py -> build\lib.win-amd64-3.8\MySQLdb copying MySQLdb\times.py -> build\lib.win-amd64-3.8\MySQLdb creating build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants_init_.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.8\MySQLdb\constants copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.8\MySQLdb\constants running build_ext building '_mysql' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\Pavan P\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\MySQL-python\setup.py'"'"'; file='"'"'C:\Users\Pavan P\AppData\Local\Temp\pip-install-6b6uth5n\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\Pavan P\AppData\Local\Temp\pip-record-lt8udbbu\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Pavan P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\MySQL-python' Check the logs for full command output.

like image 873
Pavan P Avatar asked Oct 30 '25 00:10

Pavan P


1 Answers

you do not need to install visual studio build tools, instead, try installing the following modules which are all the same ones,

pip install pymysql
pip install mysql-connector
pip install mysql-connector-python

Note:

all the modules listed here are the same thing

like image 104
Ahmad Waqar Avatar answered Nov 01 '25 14:11

Ahmad Waqar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!