title: python pyinstaller no library called "cairo" was found
body: <p>While compiling an app dependent on <code>matplotlib</code> and <code>pyside2</code> with <code>pyinstaller</code> I get these errors </p>
  
  <p><strong>Environment</strong></p>
  
  <pre><code> PyInstaller: 3.5
   Python: 3.7.5
   Platform: Windows-10-10.0.14393-SP0
  </code></pre>
  
  <p><strong>Errors</strong></p>
  
  <pre><code>    31256 INFO:   Matplotlib backend GTK3Agg: ignored
      Traceback (most recent call last):
      File c:\users\digikwondo\pycharmprojects\guitest\venv\lib\site- 
      packages\matplotlib\backends\backend_cairo.py, line 14, in &lt;module&gt;
      import cairo
      ModuleNotFoundError: No module named cairo
  
      During handling of the above exception, another exception occurred:
  
      Traceback (most recent call last):
      File "&lt;string&gt;", line 12, in &lt;module&gt;
      File "c:\users\digikwondo\pycharmprojects\guitest\venv\lib\site- 
      packages\matplotlib\backends\backend_gtk3agg.py, line 4, in &lt;module&gt;
      from . import backend_agg, backend_cairo, backend_gtk3
      File "c:\users\digikwondo\pycharmprojects\guitest\venv\lib\site- 
      packages\matplotlib\backends\backend_cairo.py", line 20, in &lt;module&gt;
      import cairocffi as cairo
      File "c:\users\digikwondo\pycharmprojects\guitest\venv\lib\site-packages\cairocffi\__init__.py", line 50, in &lt;module&gt;
      ('libcairo.so', 'libcairo.2.dylib', 'libcairo-2.dll'))
      File "c:\users\digikwondo\pycharmprojects\guitest\venv\lib\site-packages\cairocffi\__init__.py", line 45, in dlopen
      raise OSError(error_message)  # pragma: no cover
      OSError: no library called "cairo" was found
      no library called "libcairo-2" was found
      cannot load library 'libcairo.so': error 0x7e
      cannot load library 'libcairo.2.dylib': error 0x7e
      cannot load library 'libcairo-2.dll': error 0x7e
  </code></pre>
  
  <p>my import statements</p>
  
  <pre><code>from PySide2.QtWidgets import (QApplication, QLabel, QPushButton, QMessageBox, QWidget, QLineEdit, QTextBrowser, QListWidget, QFileDialog, QTabWidget, QGridLayout) 
  from PySide2.QtCore import (Slot, QRect, QFile, QTextStream)
  from PySide2.QtGui import (QIcon, QFont)
  from zipfile import (ZipFile)
  from pandas.io.common import EmptyDataError
  import glob
  import sys
  import os
  import time
  import pandas
  import logging
  import webbrowser
  from pathlib import Path
  from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
  from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
  import matplotlib.pyplot as plt
  from matplotlib.ticker import MaxNLocator as mxl
  from pandas.plotting import register_matplotlib_converters
  register_matplotlib_converters()
  </code></pre>
  
  <p>pip packages installed</p>
  
  <pre><code>altgraph          0.16.1
  arrow             0.15.4
  attrs             19.3.0
  cairocffi         1.1.0
  certifi           2019.9.11
  cffi              1.13.2
  chardet           3.0.4
  Click             7.0
  cycler            0.10.0
  future            0.18.2
  joblib            0.14.0
  kiwisolver        1.1.0
  llvmlite          0.30.0
  matplotlib        3.1.1
  Nuitka            0.6.5
  numba             0.45.1
  numpy             1.17.4
  packaging         19.1
  pandas            0.25.1
  pefile            2019.4.18
  pip               19.0.3
  pip-review        1.0
  pip-tools         4.1.0
  pycparser         2.19
  PyInstaller       3.5
  pyparsing         2.4.2
  pypiwin32         223
  PyQt5             5.13.0
  PyQt5-sip         4.19.19
  pyqt5-tools       5.13.0.1.5
  PySide2           5.13.1
  python-dateutil   2.8.1
  python-dotenv     0.10.3
  pytz              2019.2
  pywin32           225
  pywin32-ctypes    0.2.0
  scikit-learn      0.21.3
  scipy             1.3.1
  setuptools        41.2.0
  setuptools-freeze 0.0.1
  shiboken2         5.13.1
  sip               4.19.8
  six               1.13.0
  tornado           6.0.3
  umap              0.1.1
  umap-learn        0.3.10
  </code></pre>
  
  <p>i am not sure what the implications are as pyinstaller finishes and my app runs without issues. 
  would appreciate some help understanding these errors and how to resolve them </p>