I encountered this same problem. It is caused by PyInstaller using incorrect versions of ssleay32.dll and libeay32.dll.
To fix, download and install "Win32 OpenSSL v1.0.1e".
Then create a spec file for your PyInstaller project:
pyi-makespec browser.py
Open your spec file, named browser.spec
, and below the a = Analysis(['browser.py'])
line, add:
for d in range(len(a.binaries)):
if a.binaries[d][0].lower() == 'ssleay32.dll':
print a.binaries[d]
a.binaries[d] = ('ssleay32.dll', 'C:\\\OpenSSL-Win32\\ssleay32.dll', 'BINARY')
if a.binaries[d][0].lower() == 'libeay32.dll':
print a.binaries[d]
a.binaries[d] = ('libeay32.dll', 'C:\\OpenSSL-Win32\\libeay32.dll', 'BINARY')
This will tell PyInstaller to use the OpenSSL-Win32 dlls instead of the ones your Python installation is using.
When running the Python script, my Python installation preferred the DLLs in my system path to those installed by pyOpenSSL/egenix, but when bundling with PyInstaller, it seems to prefer the pyOpenSSL/egenix ones. This should fix that.