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?
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)