basemap with Python26?

Hi
I'm getting the traceback

from mpl_toolkits.basemap import Basemap

/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/__init__.py", line 39, in <module>
    import _geoslib, pupynere, netcdftime
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/pupynere.py", line 37, in <module>
    from dap.client import open as open_remote
  File "/home/myeates/lib/python2.6/site-packages/dap/client.py", line 4, in <module>
    from dap.util.http import openurl
  File "/home/myeates/lib/python2.6/site-packages/dap/util/http.py", line 3, in <module>
    import httplib2
File "/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py", line 717, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

anyone what this is about?

Mathew

Yeates, Mathew C wrote:

Hi
I'm getting the traceback

from mpl_toolkits.basemap import Basemap
        
/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/__init__.py", line 39, in <module>
    import _geoslib, pupynere, netcdftime
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/pupynere.py", line 37, in <module>
    from dap.client import open as open_remote
  File "/home/myeates/lib/python2.6/site-packages/dap/client.py", line 4, in <module>
    from dap.util.http import openurl
  File "/home/myeates/lib/python2.6/site-packages/dap/util/http.py", line 3, in <module>
    import httplib2
File "/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py", line 717, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

anyone what this is about?

Mathew
  
Mathew: I can't reproduce that with python 2.6 - I wonder perhaps if your python 2.6 is missing SSL support?

Try this:

Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import httplib
>>> dir(httplib)
['ACCEPTED', 'BAD_GATEWAY', 'BAD_REQUEST', 'BadStatusLine', 'CONFLICT', 'CONTINUE', 'CREATED', 'CannotSendHeader', 'CannotSendRequest', 'EXPECTATION_FAILED', 'FAILED_DEPENDENCY', 'FORBIDDEN', 'FOUND', 'FakeSocket', 'GATEWAY_TIMEOUT', 'GONE', 'HTTP', 'HTTPConnection', 'HTTPException', 'HTTPMessage', 'HTTPResponse', 'HTTPS', 'HTTPSConnection', 'HTTPS_PORT', 'HTTP_PORT', 'HTTP_VERSION_NOT_SUPPORTED', 'IM_USED', 'INSUFFICIENT_STORAGE', 'INTERNAL_SERVER_ERROR', 'ImproperConnectionState', 'IncompleteRead', 'InvalidURL', 'LENGTH_REQUIRED', 'LOCKED', 'LineAndFileWrapper', 'MAXAMOUNT', 'METHOD_NOT_ALLOWED', 'MOVED_PERMANENTLY', 'MULTIPLE_CHOICES', 'MULTI_STATUS', 'NON_AUTHORITATIVE_INFORMATION', 'NOT_ACCEPTABLE', 'NOT_EXTENDED', 'NOT_FOUND', 'NOT_IMPLEMENTED', 'NOT_MODIFIED', 'NO_CONTENT', 'NotConnected', 'OK', 'PARTIAL_CONTENT', 'PAYMENT_REQUIRED', 'PRECONDITION_FAILED', 'PROCESSING', 'PROXY_AUTHENTICATION_REQUIRED', 'REQUESTED_RANGE_NOT_SATISFIABLE', 'REQUEST_ENTITY_TOO_LARGE', 'REQUEST_TIMEOUT', 'REQUEST_URI_TOO_LONG', 'RESET_CONTENT', 'ResponseNotReady', 'SEE_OTHER', 'SERVICE_UNAVAILABLE', 'SWITCHING_PROTOCOLS', 'StringIO', 'TEMPORARY_REDIRECT', 'UNAUTHORIZED', 'UNPROCESSABLE_ENTITY', 'UNSUPPORTED_MEDIA_TYPE', 'UPGRADE_REQUIRED', 'USE_PROXY', 'UnimplementedFileMode', 'UnknownProtocol', 'UnknownTransferEncoding', '_CS_IDLE', '_CS_REQ_SENT', '_CS_REQ_STARTED', '_UNKNOWN', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'error', 'mimetools', 'py3kwarning', 'responses', 'socket', 'ssl', 'test', 'urlsplit', 'warnings']
>>>

If the import ssl fails, you have your answer. In that case, there is probably not https support in httplib.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

yes, thats the problem. I need ssl
Thx
Mathew

···

________________________________________
From: Jeff Whitaker [jswhit@...146...]
Sent: Thursday, October 23, 2008 10:01 AM
To: Yeates, Mathew C
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] basemap with Python26?

Yeates, Mathew C wrote:

Hi
I'm getting the traceback

from mpl_toolkits.basemap import Basemap

/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py:44: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/__init__.py", line 39, in <module>
    import _geoslib, pupynere, netcdftime
  File "/home/myeates/lib/python2.6/site-packages/mpl_toolkits/basemap/pupynere.py", line 37, in <module>
    from dap.client import open as open_remote
  File "/home/myeates/lib/python2.6/site-packages/dap/client.py", line 4, in <module>
    from dap.util.http import openurl
  File "/home/myeates/lib/python2.6/site-packages/dap/util/http.py", line 3, in <module>
    import httplib2
File "/home/myeates/lib/python2.6/site-packages/httplib2/__init__.py", line 717, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

anyone what this is about?

Mathew

Mathew: I can't reproduce that with python 2.6 - I wonder perhaps if
your python 2.6 is missing SSL support?

Try this:

Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import httplib
>>> dir(httplib)
['ACCEPTED', 'BAD_GATEWAY', 'BAD_REQUEST', 'BadStatusLine', 'CONFLICT',
'CONTINUE', 'CREATED', 'CannotSendHeader', 'CannotSendRequest',
'EXPECTATION_FAILED', 'FAILED_DEPENDENCY', 'FORBIDDEN', 'FOUND',
'FakeSocket', 'GATEWAY_TIMEOUT', 'GONE', 'HTTP', 'HTTPConnection',
'HTTPException', 'HTTPMessage', 'HTTPResponse', 'HTTPS',
'HTTPSConnection', 'HTTPS_PORT', 'HTTP_PORT',
'HTTP_VERSION_NOT_SUPPORTED', 'IM_USED', 'INSUFFICIENT_STORAGE',
'INTERNAL_SERVER_ERROR', 'ImproperConnectionState', 'IncompleteRead',
'InvalidURL', 'LENGTH_REQUIRED', 'LOCKED', 'LineAndFileWrapper',
'MAXAMOUNT', 'METHOD_NOT_ALLOWED', 'MOVED_PERMANENTLY',
'MULTIPLE_CHOICES', 'MULTI_STATUS', 'NON_AUTHORITATIVE_INFORMATION',
'NOT_ACCEPTABLE', 'NOT_EXTENDED', 'NOT_FOUND', 'NOT_IMPLEMENTED',
'NOT_MODIFIED', 'NO_CONTENT', 'NotConnected', 'OK', 'PARTIAL_CONTENT',
'PAYMENT_REQUIRED', 'PRECONDITION_FAILED', 'PROCESSING',
'PROXY_AUTHENTICATION_REQUIRED', 'REQUESTED_RANGE_NOT_SATISFIABLE',
'REQUEST_ENTITY_TOO_LARGE', 'REQUEST_TIMEOUT', 'REQUEST_URI_TOO_LONG',
'RESET_CONTENT', 'ResponseNotReady', 'SEE_OTHER', 'SERVICE_UNAVAILABLE',
'SWITCHING_PROTOCOLS', 'StringIO', 'TEMPORARY_REDIRECT', 'UNAUTHORIZED',
'UNPROCESSABLE_ENTITY', 'UNSUPPORTED_MEDIA_TYPE', 'UPGRADE_REQUIRED',
'USE_PROXY', 'UnimplementedFileMode', 'UnknownProtocol',
'UnknownTransferEncoding', '_CS_IDLE', '_CS_REQ_SENT',
'_CS_REQ_STARTED', '_UNKNOWN', '__all__', '__builtins__', '__doc__',
'__file__', '__name__', '__package__', 'error', 'mimetools',
'py3kwarning', 'responses', 'socket', 'ssl', 'test', 'urlsplit', 'warnings']
>>>

If the import ssl fails, you have your answer. In that case, there is
probably not https support in httplib.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg