I think the error in the example above is from this line
frames=[dict(data= [dict(lat=lats[:k+1],
lon=lons[:k+1])
],
traces= [0],
name='frame{}'.format(k)
) for k in range(1, len(df))]
The trace types for the traces in the frames are not specified, so they are defaulting to scatter, which doesn’t have lat/lon properties. Try adding type='scattermapbox' here.
frames=[dict(data=[dict(
type='scattermapbox',
lat=lats[:k+1],
lon=lons[:k+1])
],
traces= [0],
name='frame{}'.format(k)
) for k in range(1, len(df))]