I didn´t find the source of the problem, even after many (many!) attempts with the help of chatgpt, which wasn´t a great help, by the way!
The 'solution' was to uninstall Python, restart the computer (just in case!), and reinstall everything (I don´t use Anaconda!). It took me about 10 minutes... compared with the couple hours looking for a solution. However, it is puzzling what happened, and a bit worrying.
My guess it was a Windows related thing...