It may happen that while running the spyder debugger it gives a strange error:
runfile() got an unexpected keyword argument 'current_namespace'
I checked on the internet and I managed to solve the problem by downgrading some anaconda packages:
if you have the same problem open the terminal and paste these two commands, it worked fine for me:
conda activate my_env conda install ipykernel=6.2.0