According to the experts in this video it currently takes half a year to offset the emissions related to the production and installation of wind and solar. After that its completely green energy. And solar cells last for at least 20 years.
So by purchasing from other countries you might outsource a little bit of emissions but save loads compared to running carbon-based plants.