title: Installation of PyCairo on Windows
body: <p>I see there is an old question about a similar thing here:</p>
  
  <p><a href="https://stackoverflow.com/questions/8704407/how-do-you-install-pycairo-cairo-for-python-on-windows">How do you install PyCairo (Cairo for Python) on Windows?</a></p>
  
  <p>Since it's from 2012, I guess it's out of date.</p>
  
  <p>I am trying to install pycairo on my Windows 7 64-bit laptop where I have  Python 3.6.3 installed. I also have the latest setuptools installed if that matters.</p>
  
  <p>I am facing the error below.</p>
  
  <pre><code>C:\Programs\Python36&gt;python
  Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; ^Z
  
  
  C:\Programs\Python36&gt;pip install pycairo
  Collecting pycairo
    Using cached pycairo-1.15.4.tar.gz
  Installing collected packages: pycairo
    Running setup.py install for pycairo ... error
      Complete output from command c:\programs\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\petr
  op01\\AppData\\Local\\Temp\\pip-build-vbfoifen\\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\petrop01\AppData\Local\Temp\
  pip-rrp9zlme-record\install-record.txt --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\cairo
      copying cairo\__init__.py -&gt; build\lib.win-amd64-3.6\cairo
      running build_ext
      building 'cairo._cairo' extension
      creating build\temp.win-amd64-3.6
      creating build\temp.win-amd64-3.6\Release
      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 -Ic:\prog
  rams\python36\include -Ic:\programs\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:
  \Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-
  IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tccairo/devic
  e.c /Fobuild\temp.win-amd64-3.6\Release\cairo/device.obj
      device.c
      c:\users\petrop01\appdata\local\temp\pip-build-vbfoifen\pycairo\cairo\pycairo.h(37): fatal error C1083: Cannot open inclu
  de file: 'cairo.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit statu
  s 2
  
      ----------------------------------------
  Command "c:\programs\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\petrop01\\AppData\\Local\\Te
  mp\\pip-build-vbfoifen\\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\petrop01\AppData\Local\Temp\pip-rrp9zlme-record\inst
  all-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\petrop01\AppData\Local\Tem
  p\pip-build-vbfoifen\pycairo\
  
  C:\Programs\Python36&gt;
  </code></pre>
  
  <p>Since I am knew to Python and to all its things this sounds like too much for me. As far as I understand this pycairo is not a pure Python package so it requires a Visual C++ 14 compiler (which I just installed from here: <a href="http://landinghub.visualstudio.com/visual-cpp-build-tools" rel="nofollow noreferrer">http://landinghub.visualstudio.com/visual-cpp-build-tools</a>, I took the 2015 version). </p>
  
  <p>But I am still having the same issue when I run the <code>pip install pycairo</code> command.  </p>