imapclient error on Windows

前端 未结 2 1864
无人共我
无人共我 2020-12-18 05:08

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

相关标签:
2条回答
  • 2020-12-18 05:24

    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__

    0 讨论(0)
  • 2020-12-18 05:24

    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.

    0 讨论(0)
提交回复
热议问题