Python Exchangelib connection issue, keyError 20

969 views Asked by At

I'm trying to connect to office365 exchange account using python 3.6 and exchangelib - but I get an error:

exchangelib\version.py", line 102, in api_version return self.API_VERSION_MAP[self.major_version][self.minor_version]

KeyError: 20

I'm just executing the simplest possible version of the connection code, but specifying configuration instead of autodiscover doesn't work as well:

      credentials = Credentials(username=<login>, password=<password>)    
      self.__account = Account(primary_smtp_address=mailbox, 
                               credentials=credentials,
                               autodiscover=True, access_type=DELEGATE)

What can be the issue here?

1

There are 1 answers

0
Erik Cederstrand On BEST ANSWER

This is due to an unexpected build number from EWS. Fixed in https://github.com/ecederstrand/exchangelib/issues/221