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.
Asked
Active
Viewed 1.0k times
4

snakecharmerb
- 47,570
- 11
- 100
- 153

Pavan P
- 49
- 1
- 1
- 4
-
Does this answer your question? [pip install mysqlclient error](https://stackoverflow.com/questions/51062920/pip-install-mysqlclient-error) – snakecharmerb Jul 15 '22 at 06:01
3 Answers
4
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

Ahmad Waqar
- 474
- 4
- 7
-
Acording to PyPi `mysql-connector` [page](https://pypi.org/project/mysql-connector) this package is deprecated, just need to install the `mysql-connector-python` – Danilo Matrangolo Marano Mar 27 '23 at 19:41
2
Here is the error, looks like you need to install MS visual C++ 14.0
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

Isaiah4110
- 9,855
- 1
- 40
- 56
1
The fastest and best way you solve your issues is modules whl. python -m pip install mysqlclient==1.4.2.post1

d3vkidhash
- 301
- 1
- 10