I’m new to programming. I’m trying to reproduce some code from a book, but got stuck after just a pair of lines here:
import imapclient
imapObj=imapclient.IMAPClient('imap.mail.ru',ssl=True)
after running this next error shows up:
Traceback (most recent call last):
File "C:/Users/vinni/AppData/Local/Programs/Python/Python39/getMail.py", line 2, in
imapObj=imapclient.IMAPClient('imap.mail.ru',ssl=True)
File "C:\Users\vinni\AppData\Local\Programs\Python\Python39\lib\site-packages\imapclient\imapclient.py", line 254, in **init**
self._imap = self._create_IMAP4()
File "C:\Users\vinni\AppData\Local\Programs\Python\Python39\lib\site-packages\imapclient\imapclient.py", line 288, in _create_IMAP4
return tls.IMAP4_TLS(self.host, self.port, self.ssl_context,
File "C:\Users\vinni\AppData\Local\Programs\Python\Python39\lib\site-packages\imapclient\tls.py", line 44, in **init**
imaplib.IMAP4. **init** (self, host, port)
File "C:\Users\vinni\AppData\Local\Programs\Python\Python39\lib\imaplib.py", line 202, in **init**
self.open(host, port, timeout)
TypeError: open() takes 3 positional arguments but 4 were given
I tried it with different imap servers, tried reinstalling imapclient, but nothing seems to work. My Python version is 3.9.0.
What might cause this error?