falha na instalação do pacote mysqlclient

05/08/2018

17

Não consigo instalar o pacote mysqlclient em um projeto Django. Uso Pycharm.

Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
Building wheels for collected packages: mysqlclient
Running setup.py bdist_wheel for mysqlclient: started
Running setup.py bdist_wheel for mysqlclient: finished with status 'error'
Complete output from command E:\\Bitnami\\djangostack-2.0.7-0\\apache2\\htdocs\\projetofinal\\venv\\Scripts\\python.exe -u -c "import setuptools, tokenize;__file__='C:\\\\Users\\\\CW\\\\AppData\\\\Local\\\\Temp\\\\pycharm-packaging\\\\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\\CW\\AppData\\Local\\Temp\\pip-wheel-odqton8q --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\\lib.win-amd64-3.6
copying _mysql_exceptions.py -> build\\lib.win-amd64-3.6
creating build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\__init__.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\compat.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\connections.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\converters.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\cursors.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\release.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\times.py -> build\\lib.win-amd64-3.6\\MySQLdb
creating build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\__init__.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\CLIENT.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\CR.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\ER.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\FIELD_TYPE.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\FLAG.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\REFRESH.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

----------------------------------------
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
Complete output from command E:\\Bitnami\\djangostack-2.0.7-0\\apache2\\htdocs\\projetofinal\\venv\\Scripts\\python.exe -u -c "import setuptools, tokenize;__file__='C:\\\\Users\\\\CW\\\\AppData\\\\Local\\\\Temp\\\\pycharm-packaging\\\\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\\CW\\AppData\\Local\\Temp\\pip-record-9t7kv_w8\\install-record.txt --single-version-externally-managed --compile --install-headers E:\\Bitnami\\djangostack-2.0.7-0\\apache2\\htdocs\\projetofinal\\venv\\include\\site\\python3.6\\mysqlclient:
running install
running build
running build_py
creating build
creating build\\lib.win-amd64-3.6
copying _mysql_exceptions.py -> build\\lib.win-amd64-3.6
creating build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\__init__.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\compat.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\connections.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\converters.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\cursors.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\release.py -> build\\lib.win-amd64-3.6\\MySQLdb
copying MySQLdb\\times.py -> build\\lib.win-amd64-3.6\\MySQLdb
creating build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\__init__.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\CLIENT.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\CR.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\ER.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\FIELD_TYPE.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\FLAG.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
copying MySQLdb\\constants\\REFRESH.py -> build\\lib.win-amd64-3.6\\MySQLdb\\constants
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

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

Failed building wheel for mysqlclient
Command "E:\\Bitnami\\djangostack-2.0.7-0\\apache2\\htdocs\\projetofinal\\venv\\Scripts\\python.exe -u -c "import setuptools, tokenize;__file__='C:\\\\Users\\\\CW\\\\AppData\\\\Local\\\\Temp\\\\pycharm-packaging\\\\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\\CW\\AppData\\Local\\Temp\\pip-record-9t7kv_w8\\install-record.txt --single-version-externally-managed --compile --install-headers E:\\Bitnami\\djangostack-2.0.7-0\\apache2\\htdocs\\projetofinal\\venv\\include\\site\\python3.6\\mysqlclient" failed with error code 1 in C:\\Users\\CW\\AppData\\Local\\Temp\\pycharm-packaging\\mysqlclient\\
Responder

Post mais votado

28/09/2018

Boa tarde Bruno, tudo bem? Você precisa instalar o Microsoft Visual C++ 14.0, ele é necessário. Abraço.
Responder

Mais Posts

18/06/2019

Marcos Junior

Boa noite passei pelo mesmo problema e resolvi da seguinte maneira usando os seguintes comando no ubuntu ...
1 - sudo apt-get install python-dev default-libmysqlclient-dev
2 - pip install mysqlclient

Resolvido o problema...
Responder
×
+1 DevUP
Acesso diário, +1 DevUP
Parabéns, você está investindo na sua carreira