4
respostas

Problema já ao instalar o mysqlclient

Olá! Quando tento instalar o mysqlclient recebo o seguinte erro:

Command "C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\MARCEL1\AppData\Local\Temp\pip-install-s4dxs9 i4\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\MARCEL 1\AppData\Local\Temp\pip-record-h4m79smo\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\include\si te\python3.7\mysqlclient" failed with error code 1 in C:\Users\MARCEL~1\AppData\Local\Temp\pip-install-s4dxs9i4\mysqlclient\

4 respostas

Instale a versão mais recente do setuptools

pip install -U setuptools
pip install -U wheel

Olá Otávio, Fiz as instalações, mas o problema ainda persiste. Segue a mensage completa que recebo, inclusive com a instalação das versões mais atualizadas:

(venv) C:\Users\MarceloPPereira\PycharmProjects\jogoteca>pip install -U setuptools Requirement already up-to-date: setuptools in c:\users\marceloppereira\pycharmprojects\jogoteca\venv\lib\site-packages (41.0.1) You are using pip version 10.0.1, however version 19.1.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(venv) C:\Users\MarceloPPereira\PycharmProjects\jogoteca>pip install -U wheel Requirement already up-to-date: wheel in c:\users\marceloppereira\pycharmprojects\jogoteca\venv\lib\site-packages (0.33.4) You are using pip version 10.0.1, however version 19.1.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

(venv) C:\Users\MarceloPPereira\PycharmProjects\jogoteca>pip3.exe install mysqlclient Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz Building wheels for collected packages: mysqlclient Running setup.py bdist_wheel for mysqlclient ... error Complete output from command C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\MARCEL1\AppData\Local\Te mp\pip-install-h_d54ss5\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\MARCEL1\AppData\Local\Temp\pip-wheel-smjx5mn0 --python-tag cp37: running bdist_wheel 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\FIELDTYPE.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 creating build\temp.win32-3.7 creating build\temp.win32-3.7\Release creating build\temp.win32-3.7\Release\MySQLdb D:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversioninfo=(1,4,2,'post',1) -D__version__= 1.4.2.post1 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -IC:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\include -IC:\Users\MarceloPPereira\AppData\LocalPrograms\Python\Python37-32\include -IC:\Users\MarceloPPereira\AppData\Local\Programs\Python\Python37-32\include "-ID:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14. 21.27702\ATLMFC\include" "-ID:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-ID :\Windows Kits\10\include\10.0.17763.0\ucrt" "-ID:\Windows Kits\10\include\10.0.17763.0\shared" "-ID:\Windows Kits\10\include\10.0.17763.0\um" "-ID:\Windows Kits\10\include\10.0.17763.0\win rt" "-ID:\Windows Kits\10\include\10.0.17763.0\cppwinrt" /TcMySQLdb/mysql.c /Fobuild\temp.win32-3.7\Release\MySQLdb/mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS mysql.c MySQLdb/mysql.c(29): fatal error C1083: NÆo ‚ poss¡vel abrir arquivo incluir: 'mysql.h': No such file or directory error: command 'D:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\cl.exe' failed with exit status 2 ...


Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Failed to build mysqlclient Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error Complete output from command C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\MARCEL1\AppData\Local\ Temp\pip-install-h_d54ss5\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\MARCEL1\AppData\Local\Temp\pip-record-qq6ve5k3\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\MarceloPPereira\PycharmProjectsjogoteca\venv\include\site\python3.7\mysqlclient: 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\FIELDTYPE.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 creating build\temp.win32-3.7 creating build\temp.win32-3.7\Release creating build\temp.win32-3.7\Release\MySQLdb D:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversioninfo=(1,4,2,'post',1) -D__version_ =1.4.2.post1 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -IC:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\include -IC:\Users\MarceloPPereira\AppData\Loca l\Programs\Python\Python37-32\include -IC:\Users\MarceloPPereira\AppData\Local\Programs\Python\Python37-32\include "-ID:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\1 4.21.27702\ATLMFC\include" "-ID:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "- ID:\Windows Kits\10\include\10.0.17763.0\ucrt" "-ID:\Windows Kits\10\include\10.0.17763.0\shared" "-ID:\Windows Kits\10\include\10.0.17763.0\um" "-ID:\Windows Kits\10\include\10.0.17763.0\w inrt" "-ID:\Windows Kits\10\include\10.0.17763.0\cppwinrt" /TcMySQLdb/mysql.c /Fobuild\temp.win32-3.7\Release\MySQLdb/mysql.obj /Zl /DCRT_SECURE_NO_WARNINGS mysql.c MySQLdb/mysql.c(29): fatal error C1083: NÆo ‚ poss¡vel abrir arquivo incluir: 'mysql.h': No such file or directory error: command 'D:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\cl.exe' failed with exit status 2

----------------------------------------

Command "C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\MARCEL1\AppData\Local\Temp\pip-install-h_d54s s5\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\MARCEL 1\AppData\Local\Temp\pip-record-qq6ve5k3\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\MarceloPPereira\PycharmProjects\jogoteca\venv\include\si te\python3.7\mysqlclient" failed with error code 1 in C:\Users\MARCEL~1\AppData\Local\Temp\pip-install-h_d54ss5\mysqlclientYou are using pip version 10.0.1, however version 19.1.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Tenta atualizar o pip:

python -m pip install --upgrade pip