0

I am a python newbie and I am using pydap to download atmospheric data from a thredds server. I am running python 3.4 but I believe pydap has been installed using python2.7.

When I run this I get the following message -

Traceback (most recent call last): File "data.py", line 9, in from pydap.client import open_url File "/usr/local/lib/python2.7/dist-packages/pydap/client.py", line 13, in from urlparse import urlsplit, urlunsplit ImportError: No module named 'urlparse'

Any suggestions where I am going wrong ?

#!/usr/bin/python3.4



import numpy as np

import urllib

from pydap.client import open_url


dataset = open_url('http://dataserver.nccs.nasa.gov/thredds/dodsC/bypass/CREATE-

IP/CFSR/6hr/atmos/va_2010s.ncml.html')

Idos
  • 15,053
  • 14
  • 60
  • 75
gansub
  • 1,164
  • 3
  • 20
  • 47

1 Answers1

3

Usage of urlparse has been deprecated in Python 3 as seen here, so it's not included as is anymore. However it is still accessible under urllib.parse.

So either install the Python 3 version of Pydap, or run Python 2.7 instead, or go through the Pydap code and replace mentions of urlparse with urllib.parse (probably a bad idea).

  • 1
    I checked on google and I do not think there is a Python 3 version of Pydap yet. – gansub May 24 '16 at 13:17
  • Looks like it will either exist very soon or has already [happened](https://github.com/pydap/pydap/pull/9). Currently the pip install for the package under python 3 is failing for me. In the meantime try python 2.7 if you want to use this asap. – Nicolas Small May 24 '16 at 13:53