Python pip install appkit - python

I'm using python 3.6 and wanted to install appkit
I paste last logs. I tryed everything.
I got installed Visual Studio 2015.
I'm using Windows 7
creating build\temp.win-amd64-3.6\Release\cairo
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_
MINOR=17 -DPYCAIRO_VERSION_MICRO=0 -Ic:\python36\include -Ic:\python36\include "
-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program
Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files
(x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windo
ws Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\inc
lude\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0
.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winr
t" /Tccairo/device.c /Fobuild\temp.win-amd64-3.6\Release\cairo/device.obj
device.c
c:\users\rafal\appdata\local\temp\pip-install-l744mfh7\pycairo\cairo\pycairo
.h(37): fatal error C1083: Cannot open include file: 'cairo.h': No such file or
directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\B
IN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\rafal\\AppData\\Local\\Temp\\pip-install-l744mfh7\\pycairo\\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\rafal\A
ppData\Local\Temp\pip-record-r_uz_0uc\install-record.txt --single-version-extern
ally-managed --compile" failed with error code 1 in C:\Users\rafal\AppData\Local
\Temp\pip-install-l744mfh7\pycairo\
pip install pygobject
Collecting pygobject
Using cached https://files.pythonhosted.org/packages/e0/e8/1e4f21800015a9ca153
969e85fc29f7962f8f82fc5dbc1ecbdeb9dc54c75/PyGObject-3.28.3.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in c:\python36\lib\site-packages
(from pygobject) (1.16.3)
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
Complete output from command c:\python36\python.exe -u -c "import setuptools
, tokenize;__file__='C:\\Users\\rafal\\AppData\\Local\\Temp\\pip-install-ijzat7z
3\\pygobject\\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\rafal\AppData\Local\Temp\pip-record-ded1xvyr\install-record.t
xt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pygtkcompat
copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-3.6\pygtkcomp
at
copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-3.6\pygtkcompat
copying pygtkcompat\__init__.py -> build\lib.win-amd64-3.6\pygtkcompat
creating build\lib.win-amd64-3.6\gi
copying gi\docstring.py -> build\lib.win-amd64-3.6\gi
copying gi\importer.py -> build\lib.win-amd64-3.6\gi
copying gi\module.py -> build\lib.win-amd64-3.6\gi
copying gi\pygtkcompat.py -> build\lib.win-amd64-3.6\gi
copying gi\types.py -> build\lib.win-amd64-3.6\gi
copying gi\_constants.py -> build\lib.win-amd64-3.6\gi
copying gi\_error.py -> build\lib.win-amd64-3.6\gi
copying gi\_option.py -> build\lib.win-amd64-3.6\gi
copying gi\_ossighelper.py -> build\lib.win-amd64-3.6\gi
copying gi\_propertyhelper.py -> build\lib.win-amd64-3.6\gi
copying gi\_signalhelper.py -> build\lib.win-amd64-3.6\gi
copying gi\__init__.py -> build\lib.win-amd64-3.6\gi
creating build\lib.win-amd64-3.6\gi\repository
copying gi\repository\__init__.py -> build\lib.win-amd64-3.6\gi\repository
creating build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\Gdk.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-3.6\gi\ove
rrides
copying gi\overrides\Gio.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\GLib.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\GObject.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\Gtk.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\keysyms.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\Pango.py -> build\lib.win-amd64-3.6\gi\overrides
copying gi\overrides\__init__.py -> build\lib.win-amd64-3.6\gi\overrides
running build_ext
pycairo: new API
pycairo: trying include directory: 'c:\\python36\\lib\\site-packages\\cairo'
pycairo: header file ('c:\\python36\\lib\\site-packages\\cairo\\py3cairo.h')
not found
pycairo: old API
pycairo: found pycairo 1.16.3 (c:\python36\lib\site-packages)
pycairo: trying include directory: 'c:\\python36\\include\\pycairo'
pycairo: header file ('c:\\python36\\include\\pycairo\\py3cairo.h') not foun
d
pycairo: pkg-config
error: Could not find pycairo headers
----------------------------------------
Command "c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\rafal\\AppData\\Local\\Temp\\pip-install-ijzat7z3\\pygobject\\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\rafal
\AppData\Local\Temp\pip-record-ded1xvyr\install-record.txt --single-version-exte
rnally-managed --compile" failed with error code 1 in C:\Users\rafal\AppData\Loc
al\Temp\pip-install-ijzat7z3\pygobject\
C:\Users\rafal\Downloads>pip install pycairo
Requirement already satisfied: pycairo in c:\python36\lib\site-packages (1.16.3)
I downloaded GTK , by using this tutorial
https://www.gtk.org/download/windows.php
And PygoObject by using this tutorial:
http://pygobject.readthedocs.io/en/latest/getting_started.html
Can you help?

appkit on Windows uses PyGObject which requires PyCairo which requires cairo which you don't have. You have to install cairo with sources.

Related

Cannot open include file: 'mysql.h': No such file or directory

I am trying to install requirements.txt of a django project and it is giving me the following error:
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file:
'mysql.h': No such file or directory
I have tried the following commands but they don't seem to work for me
Commands that I tried:
pip install mysqlclient==1.3.4
pip install --only-binary :all: mysqlclient
error:
Installing collected packages: mysqlclient, wheel, gunicorn, psycopg2, python-dateutil, numpy, pandas, django-pandas, kuchbhi, pyparsing, pulp, sqlalchemy, xlwt, django-bootstrap-modal-forms, MarkupSafe, jinja2, branca, certifi, urllib3, chardet, idna, requests, folium, django-widget-tweaks, googlemaps, decorator, ipython-genutils, traitlets, pywin32, jupyter-core, pyrsistent, attrs, more-itertools, zipp, importlib-metadata, jsonschema, nbformat, pyzmq, tornado, jupyter-client, pickleshare, backcall, parso, jedi, wcwidth, prompt-toolkit, colorama, pygments, ipython, ipykernel, testpath, defusedxml, pandocfilters, webencodings, bleach, mistune, entrypoints, nbconvert, pywinpty, terminado, Send2Trash, prometheus-client, notebook, widgetsnbextension, ipywidgets, geojson, gmaps, django-fullcalendar, geographiclib, geopy, pillow, brotli, django-brotli, zopfli, django-static-compress, django-clear-cache, pyjwt, djangorestframework, djangorestframework-simplejwt, djangorestframework-jwt, django-cors-headers
Found existing installation: mysqlclient 1.3.12
Uninstalling mysqlclient-1.3.12:
Successfully uninstalled mysqlclient-1.3.12
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\rahul\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rahul\\AppData\\Local\\Temp\\pip-build-pul5j4z0\\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\Rahul\AppData\Local\Temp\pip-mn6g7opp-record\install-record.txt --single-version-externally-managed --compile:
c:\users\rahul\appdata\local\programs\python\python36-32\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
creating build\temp.win32-3.6\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion_info=(1,4,1,'final',0) -D__version__=1.4.1 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -Ic:\users\rahul\appdata\local\programs\python\python36-32\include -Ic:\users\rahul\appdata\local\programs\python\python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.6\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Rolling back uninstall of mysqlclient
Command "c:\users\rahul\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rahul\\AppData\\Local\\Temp\\pip-build-pul5j4z0\\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\Rahul\AppData\Local\Temp\pip-mn6g7opp-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Rahul\AppData\Local\Temp\pip-build-pul5j4z0\mysqlclient\
The problem is you're using a 32-bit version of Python 3.6, for which there aren't wheels (binary versions) for that version of mysqlclient.
You can see here in the package file list that there is a Windows x32 wheel for 1.3.12 – try that.
pip install mysqlclient==1.3.12
If that fails to install the correct wheel, download mysqlclient-1.3.12-cp36-cp36m-win32.whl from the above listing, then install it with (e.g.) pip install ./mysqlclient-1.3.12-cp36-cp36m-win32.whl
Better still, if you can, switch to the x64 version of Python.

Python pip install mysqlclient

So I downloaded Python 32 bits 1st, then I did
python -m pip install mysqlclient.
I needed Visual C++ 2015, but I had them cuz my text editors is VSCode.
I uninstalled VSCode, installed Visual Studio Build Tools, and I am getting this errors whenever I do python -m pip install mysqlclient.One, cl.exe wasnt added to my path, so I did, but it still says
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
so I downloaded the wheel package for windows, as some other stackoverflow answer said. Whenever I run it, I get
I tried downloading Python 64 bits downloading the wheels, adding cl.exe to path.
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\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\Patrik\AppData\Local\Temp\pip-wheel-o3ba369p' --python-tag cp37
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Patrik\AppData\Local\Temp\pip-install-0vmm7fdx\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" "-IC:\Program Files (x86)\Python\include" "-IC:\Program Files (x86)\Python\include" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-3.7\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Patrik\\AppData\\Local\\Temp\\pip-install-0vmm7fdx\\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\Patrik\AppData\Local\Temp\pip-record-nk0ejlkz\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
It should just work and the package mysqlclient just be installed using pip so I can use it with django.
There isn't an official wheel for the current release 1.4.4, and you are getting errors when you try to install from source.
Since you use 64-bit Python on Windows, you could install 1.4.2.post1, because there is an official wheel for that version.
python -m pip install mysqlclient==1.4.2.post1
Or, you could download an unofficial wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient, which has wheels for the latest release for 32-bit and 64-bit Python on Windows. Unless you have a particular reason to use 32-bit Python, I suggest you use 64-bit.
For example, you could download mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl (Python 3.7 64-bit for Windows) then do:
python -m pip install mysqlclient‑1.4.4‑cp37‑cp37m‑win_amd64.whl
I had a similar situation, and i did this:
sudo apt-get install python3-dev libmysqlclient-dev
afterward, inside a virtual environment:
pip3 install mysqlclient
and that was because, i had another problem with the instalation of:
pip3 install flask-mysqldb
You can use pymysql instead of mysqlclient
Install pymysql
pip install pymysql
Modify your init.py file
import pymysql
pymysql.install_as_MySQLdb()
You can start your project
FWIW: I also faced this problem on a macOS, with the error:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'xcrun' failed with exit status 1
A solution (borrowed from this related post) that worked for me was to fix the brew-installed openssl linking:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

Unable to install pattern

I am unable to install pattern library using
pip install pattern
I am getting the following error regarding mysqlclient. Initially I was getting error on Visual Studio which I resolved following the thread
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: python-docx, mysqlclient, beautifulsoup4, pattern
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\ashis.mohanty\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ASHIS~1.MOH\\AppData\\Local\\Temp\\pip-install-e2m7rr0s\\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\ASHIS~1.MOH\AppData\Local\Temp\pip-record-7_2in4ff\install-record.txt --single-version-externally-managed --compile:
c:\users\ashis.mohanty\appdata\local\programs\python\python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying _mysql_exceptions.py -> build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\users\ashis.mohanty\appdata\local\programs\python\python37\include -Ic:\users\ashis.mohanty\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Command
"c:\users\ashis.mohanty\appdata\local\programs\python\python37\python.exe
-u -c "import setuptools, tokenize;__file__='C:\\Users\\ASHIS~1.MOH\\AppData\\Local\\Temp\\pip-install-e2m7rr0s\\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\ASHIS~1.MOH\AppData\Local\Temp\pip-record-7_2in4ff\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
C:\Users\ASHIS~1.MOH\AppData\Local\Temp\pip-install-e2m7rr0s\mysqlclient\
There my be some problem(or configurations needed) in Microsoft Visual C++....Try to Install Visual C++ with Microsoft Build Tools.

Python pip install django mysql fails on Windows

I am trying to setup a django project on Windows 10 using Python 3.5 and Django 1.9. When I run the pip command to install MySQL support I get the following error. MySQL 5.7 is installed and running.
PS H:\> pip install django mysql
Requirement already satisfied (use --upgrade to upgrade): django in c:\python35\lib\site-packages
Collecting mysql
Using cached mysql-0.0.1.tar.gz
Collecting MySQL-python (from mysql)
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python, mysql
Running setup.py install for MySQL-python
Complete output from command c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\JKRATZ~1.EVE\\AppData\\Local\\Temp\\pip-build-kr3v2d0u\\MySQL-python\\setup.py';exec(compile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-id62narl-record\install-record.txt --single-version-ex
ternally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _mysql_exceptions.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
creating build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Co
nnector C 6.0.2\include" -Ic:\python35\include -Ic:\python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCL
UDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shar
ed" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.5\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\JKRATZ~1.EVE\\AppData\\Local\\Temp\\pip-build-kr3v2d0u\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', o
pen)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-id62narl-record\install-record.txt --single-version-externally-managed --compi
le" failed with error code 1 in C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-build-kr3v2d0u\MySQL-python
Installing MySQL support of Django on Windows is suffering and I came across the same question just like you. For my situation, I use python3.4, django1.8.5, I solved this problem by download wheel file from here and use pip to install it:
pip install ***.whl
I think there is an issue with finding the include file "config-win.h".
Please check out this error message:
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
The have moved the include files to a separate folder.
Now they should be located in:
C:\Program Files\MySQL\Connector C 6.0.2\include
Please try the instructions from this link:
"Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python

Error while trying to install MySQL onto Python3.4

I've run following command in command line. Please see the execution and error at the end of the code:
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio
10.0\VC\BIN\cl .exe' failed with exit status 2
D:\Python34>pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
Complete output from command D:\Python34\python.exe -c "import setuptools, t
okenize;__file__='C:\\Users\\Irfan\\AppData\\Local\\Temp\\pip-build-i5dqkio1\\My
SQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Irfan\A
ppData\Local\Temp\pip-v08vge52-record\install-record.txt --single-version-extern
ally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.4
copying _mysql_exceptions.py -> build\lib.win32-3.4
creating build\lib.win32-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb
creating build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\const
ants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constant
s
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.4
creating build\temp.win32-3.4\Release
C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /
MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\
Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -ID:\Python34\include
-ID:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Z
l
_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':
No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl
.exe' failed with exit status 2
----------------------------------------
Command "D:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\Irfan\\AppData\\Local\\Temp\\pip-build-i5dqkio1\\MySQL-python\\setup.py
';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record C:\Users\Irfan\AppData\Local\Temp\pi
p-v08vge52-record\install-record.txt --single-version-externally-managed --compi
le" failed with error code 1 in C:\Users\Irfan\AppData\Local\Temp\pip-build-i5dq
kio1\MySQL-python
MySQL-Python is not compatible with Python 3.4. Please use mysqlclient https://pypi.python.org/pypi/mysqlclient

Categories