title: Error "variable is not defined", but the variable can be called in the console
body: <p>I use python on Spyder. My script uses a variable called imgs. I have the following error : name 'imgs' is not defined. But when I try to call imgs in the console, it works, I don't have any error.</p>
  
  <p>Then, I tried to write x=2 in the console of Spyder. Then, I executed a script on spyder (white juste 1 line : print(x)), and I still have the same error : name 'x' is not defined.</p>
  
  <p>I never had this error before</p>
  
  <p><a href="https://i.stack.imgur.com/M0hyK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M0hyK.png" alt="enter image description here"></a></p>