Environment that I\'m having trouble on: Python 2.7.11 on Windows10 (patched up to date). Python installed via a msi. I\'ve checked PATH settings in settings, and it\'s set
This is not a final answer, but the work around that I've found is to uninstall imapclient and install an older version. Version 0.13 (and 0.11) worked for me, however after upgrading to 1.0.1 I got the same error message that you posted.
To uninstall imapclient with pip, run:
pip uninstall imapclient
To install the older 0.13 version with pip, run:
pip install imapclient==0.13
To verify the version of imapclient, from the interactive shell run:
>>> import imapclient
>>> imapclient.__version__
Here's a workaround that worked for me (Python 3.5, Windows 10), and which doesn't require downgrading:
from backports import ssl
from imapclient import IMAPClient
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
server = IMAPClient('imap.gmail.com', ssl=True, ssl_context=context)
The above code was derived from the developer's workaround here, but I found I only needed the one line defining context
to make it work. Specifying other SSL/TLS protocols also worked.