Can't load smtplib

S-boy sushiboy21 at gmail.com
Thu Feb 12 14:40:57 EST 2009


I can't seem to import smtplib in either a script or the command line
interpreter.

When I try to import smtp, there seems to be some kind of collision
with urllib2. I get a weird error about Web server authorization, even
though I'm not calling urllib2.

Any ideas on what might be causing this?

Here's the mess....

Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin

>>> import smtplib

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/smtplib.py", line 46, in <module>
    import email.Utils
  File "email.py", line 4, in <module>
    response = urlopen("https://webmail.canwest.com")
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 124, in urlopen
    return _opener.open(url, data)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 387, in open
    response = meth(req, response)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 425, in error
    return self._call_chain(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized ( The server requires
authorization to fulfill the request. Access to the Web server is
denied. Contact the server administrator.  )



More information about the Python-list mailing list