4
respostas

Problemas na instalação do mysql

$ pip3 install flask_mysqldb==0.2.0 Collecting flask_mysqldb==0.2.0 Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB) Requirement already satisfied: Flask>=0.10 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from flask_mysqldb==0.2.0) (1.1.1) Collecting mysqlclient Using cached mysqlclient-1.4.6.tar.gz (85 kB) Requirement already satisfied: Jinja2>=2.10.1 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from Flask>=0.10->flask_mysqldb==0.2. 0) (2.11.1) Requirement already satisfied: itsdangerous>=0.24 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from Flask>=0.10->flask_mysqldb== 0.2.0) (1.1.0) Requirement already satisfied: click>=5.1 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from Flask>=0.10->flask_mysqldb==0.2.0) ( 7.0) Requirement already satisfied: Werkzeug>=0.15 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from Flask>=0.10->flask_mysqldb==0.2. 0) (1.0.0) Requirement already satisfied: MarkupSafe>=0.23 in c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\lib\site-packages (from Jinja2>=2.10.1->Flask>=0.10->f lask_mysqldb==0.2.0) (1.1.1) Installing collected packages: mysqlclient, flask-mysqldb Running setup.py install for mysqlclient ... error ERROR: Command errored out with exit status 1: command: 'c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\PAULAP~ 1\AppData\Local\Temp\pip-install-dpehif5z\mysqlclient\setup.py'"'"'; file='"'"'C:\Users\PAULAP1\AppData\Local\Temp\pip-install-dpehif5z\mysqlclient\setup.py'" '"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --re cord 'C:\Users\PAULAP1\AppData\Local\Temp\pip-record-rg749q22\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\paulapompeodecamargo \appdata\local\programs\python\python37-32\Include\mysqlclient' cwd: C:\Users\PAULAP~1\AppData\Local\Temp\pip-install-dpehif5z\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 "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys. argv[0] = '"'"'C:\Users\PAULAP1\AppData\Local\Temp\pip-install-dpehif5z\mysqlclient\setup.py'"'"'; file='"'"'C:\Users\PAULAP1\AppData\Local\Temp\pip-install- dpehif5z\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\PAULAP~1\AppData\Local\Temp\pip-record-rg749q22\install-record.txt' --single-version-externally-managed --compile --install-heade rs 'c:\users\paulapompeodecamargo\appdata\local\programs\python\python37-32\Include\mysqlclient' Check the logs for full command output. $

4 respostas

Você tem que antes instalar o Microsoft Visual C++ 14.0 "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

Juari, muito obrigada pela sua resposta!

Ontem fiz essa instalação e mesmo assim não deu certo :(

Devo desinstalar todo o resto para instalar o Microsoft Visual C++ 14.0 "Build Tools for Visual Studio, e somente depois disso o Python e o Pycharm?

agora esta aparecendo o seguinte erro

Traceback (most recent call last): File "C:/Users/PaulaPompeodeCamargo/PycharmProjects/untitled/jogoteca.py", line 4, in from flask_mysqldb import MySQL ModuleNotFoundError: No module named 'flask_mysqldb'

tem que instalar o módulo flask_mysqldb, pode ser no PyCharm nas preferências, ou dentro do diretório do projeto abra um terminal e dê o comando pip install flask_mysqldb