In my project base on GAE, I uses imaplib to check email of Gmail.
Below is the code:
class Mailbox:
def __init__(self):
self.m = imaplib.IMAP4_SSL("
imap.gmail.com")
.....
But below error occures when above instruction: imaplib.IMAP4_SSL
("
imap.gmail.com") excuted.
Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 501, in __call__
handler.get(*groups)
File "/base/data/home/apps/srjsimblog/1.334408786956981127/
mailBlog.py", line 82, in get
gmailBox = Mailbox()
File "/base/data/home/apps/srjsimblog/1.334408786956981127/
mailBlog.py", line 31, in __init__
self.m = imaplib.IMAP4_SSL("
imap.gmail.com")
File "/base/python_dist/lib/python2.5/imaplib.py", line 1128, in
__init__
IMAP4.__init__(self, host, port)
File "/base/python_dist/lib/python2.5/imaplib.py", line 163, in
__init__
self.open(host, port)
File "/base/python_dist/lib/python2.5/imaplib.py", line 1139, in
open
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: 'module' object has no attribute 'socket'
If I use imaplib in a standalone program with same instruction, it
works fine. Any body knows why? And how to resolve this issue?