Not a big script to check for unread messages, when launched from a file it gives the following:

C:\check_mail>c:\Python33\python.exe Traceback (most recent call last): File "", line 1, in <module> import imaplib File "c:\Python33\lib\", line 25, in <module> import binascii, errno, random, re, socket, subprocess, sys, time, calendar File "c:\Python33\lib\", line 47, in <module> import _socket ImportError: DLL load failed: Не найден указанный модуль. 

If everything is entered into the interpreter, then everything works out.


 import imaplib mail = imaplib.IMAP4_SSL('nameserver') mail.login('login', 'password')'INBOX') num = len(, 'UNSEEN')[1][0].split()) print (num) 
  • For some reason, there is no C-extension for working with sockets. Try reinstalling Python. I also recommend trying version 2.7 - maybe this is a 3000-branch specific bug. - dred
  • And if 2.x is deleted, and 3.x is left, will the error be reproduced? Some search results on this issue say that this is possibly a conflict between two versions on the same machine. - ReinRaus
  • @vorlog means not that. - ReinRaus
  • @vorlog, 1. and if explicitly specify #! c: \ Python33 \? 2. Try to remove all versions of python and reinstall only used. 3. What is in sys.path? - ReinRaus pm
  • Already deleted and reinstalled, explicitly indicating does not help either, everything in sys.path is correct and corresponds to 3.2 activestate. - Vorlog