AttributeError: module 'sunpy.net.attrs' has no attribute 'cdaweb'

I am running the example code to retrieve the CDAWeb data

from sunpy.net import Fido
from sunpy.net import attrs as a
from sunpy.timeseries import TimeSeries
trange = a.Time(‘2021/07/01’, ‘2021/07/08’)
dataset = a.cdaweb.Dataset(‘SOLO_L2_MAG-RTN-NORMAL-1-MINUTE’)
result = Fido.search(trange, dataset)
print(result)

but it returns an attribute error stating that:


AttributeError Traceback (most recent call last)
in ()
1 trange = a.Time(‘2021/07/01’, ‘2021/07/08’)
----> 2 dataset = a.cdaweb.Dataset(‘SOLO_L2_MAG-RTN-NORMAL-1-MINUTE’)
3 result = Fido.search(trange, dataset)
4 print(result)

AttributeError: module ‘sunpy.net.attrs’ has no attribute ‘cdaweb’

Has anybody experienced the same error?

1 Like

Hello!

Could you tell me what version of sunpy you are running?

Using sunpy.__version__

Thanks!

1 Like

Hello! Thank you for your reply

I was using Sunpy 2.0, but then I noticed that sunpy.net.attrs.cdaweb works on the latest version.
I then updated it to Sunpy 4.0.5 and it is now working perfectly.

Thanks