title: How to solve the ssl certificate errors while converting a python file to .exe?
body: <p>I am trying to extract text from an image using Google-Cloud_vision API. The python file runs well but I get the following error when I use pyinstaller to convert the python file to .exe file. </p>
  
  <p><a href="https://i.stack.imgur.com/4TrDy.jpg" rel="nofollow noreferrer">ssl_roots_override_callback eror</a>
  I have tried solving this issue based on the following links, but I still am getting the same error.</p>
  
  <p><a href="https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OpenSSL-Certificate" rel="nofollow noreferrer">https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OpenSSL-Certificate</a>
  <a href="https://stackoverflow.com/questions/21201238/twilio-python-module-errors-after-compiling/21206079#21206079">Twilio Python Module Errors After Compiling</a></p>
  
  <p>I tried the following:
  1. Added the path to roots.pem, cert.pem in the datas argument of the .spec file
  2. added hooks-requests.py file to hooks folder of pyinstaller</p>
  
  <pre><code>a = Analysis(['getTextFromImage.py'],
           pathex=['\\FileDirectory'],
           binaries=[],
           datas=[('FileDirectory\\cert.pem', '.'), ('FileDirectory\\roots.pem', '.') ],
           hiddenimports=[],
           hookspath=[],
           runtime_hooks=[],
           excludes=[],
           win_no_prefer_redirects=False,
           win_private_assemblies=False,
           cipher=block_cipher,
           noarchive=False)
  
  
  from PyInstaller.utils.hooks import collect_data_files
  datas = collect_data_files('requests')
  </code></pre>