0

I'm trying to download data via ftp from the NOAA website. This is CPC Global Temperature data. However I am getting a permission error. What should I do ? please

from ftplib import FTP

# ftp://ftp.cdc.noaa.gov/Datasets/cpc_global_temp/  # Dataset path   

ftp =  FTP('ftp.ncdc.noaa.gov') # NOAA ftp
ftp.login() # Anonymous
ftp.cwd('Datasets/cpc_global_temp/') # Dir datasets CPC global Temperature 
ftp.retrlines('LIST')
ftp.close()

When I make this code I get this error

error_perm: 550 Datasets/cpc_global_temp/: No such file or directory

Can anybody help me?

petezurich
  • 9,280
  • 9
  • 43
  • 57
Santos
  • 61
  • 5

1 Answers1

0

The Climate Prediction Center data is at:

ftp = FTP('ftp.cdc.noaa.gov')

Then your code should work as expected.

If you want an example of how to download one of their files:

filename = 'tmin.2020.nc'
with open(filename,'wb') as f: 
    ftp.retrbinary('RETR {}'.format(filename),f.write) 
mechanical_meat
  • 163,903
  • 24
  • 228
  • 223