Potential environmental impact of machine learning by large-scale wirelessnetworks is a major challenge for the sustainability of future smartecosystems. In this paper, we introduce sustainable machine learning infederated learning settings, using rechargeable devices that can collect energyfrom the ambient environment. We propose a practical federated learningframework that leverages intermittent energy arrivals for training, withprovable convergence guarantees. Our framework can be applied to a wide rangeof machine learning settings in networked environments, including distributedand federated learning in wireless and edge networks. Our experimentsdemonstrate that the proposed framework can provide significant performanceimprovement over the benchmark energy-agnostic federated learning settings.