4
respostas

Erro ao instalar fask_mysqldb

Consegui um erro diferente de todo mundo ''Command "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\NIUTON1\AppData\Local\Temp\pip-install-95mlz0gg\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\NIUTON1\AppData\Local\Temp\pip-record-ooehplet\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\niuton-blos\Pyc harmProjects\jogoteca\venv\include\site\python3.7\mysqlclient" failed with error code 1 in C:\Users\NIUTON~1\AppData\Local\Temp\pip-install-95mlz0gg\mysqlclientYou are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

4 respostas

Niuton,

Como já sugere na última linha vc esta usando um versão antiga do pip. Use o comando abaixo para no prompt para atualizar o pip para a versão 18.0

pip install --upgrade pip

OBS: Depois instale o fask_mysqldb

Desculpe eu cheguei a dar o comando antes de postar aqui mas tive isso de retorno: Installing collected packages: pip Found existing installation: pip 10.0.1 Uninstalling pip-10.0.1: Successfully uninstalled pip-10.0.1 Rolling back uninstall of pip Exception: Traceback (most recent call last): File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\basecommand.py", line 228, in main status = self.run(options, args) File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\commands\install.py", line 335, in run use_user_site=options.use_user_site, File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\req_init__.py", line 49, in installgiven_reqs **kwargs File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\req\req_install.py", line 748, in install use_user_site=use_user_site, pycompile=pycompile, File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\req\req_install.py", line 961, in move_wheel_files warn_script_location=warn_script_location, File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_internal\wheel.py", line 431, in move_wheel_files generated.extend(maker.make(spec)) File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_vendor\distlib\scripts.py", line 403, in make self.makescript(entry, filenames, options=options) File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_vendor\distlib\scripts.py", line 307, in makescript self.writescript(scriptnames, shebang, script, filenames, ext) File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_vendor\distlib\scripts.py", line 243, in writescript launcher = self.getlauncher('t') File "C:\Users\niuton-blos\PycharmProjects\jogoteca\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip_vendor\distlib\scripts.py", line 382, in getlauncher result = finder(distlib_package).find(name).bytes AttributeError: 'NoneType' object has no attribute 'bytes'

Amigo,

Faz assim:

# PRIMEIRO DESINSTALA
python -m pip uninstall pip

#AGORA INSTALA DE NOVO COM UPGRADE
python -m pip install -U pip

Se der errado acima

Se não der certo baixando novo o arquivo get-pip.py link: https://bootstrap.pypa.io/get-pip.py

instala com:

python get-pip.py

Agora o pip parece estar funcionando, mas ainda não consegui instalar o mysql: _mysql.c(29): fatal error C1083: NÆo ‚ poss¡vel abrir arquivo incluir: 'mysql.h': No such file or directory