# Why this code runs in console, but fails in the spyder editor?

Good afternoon.
Started a test algorithm differential_evolution to check the work of the library scipy.

The code runs in the console, but fails in the Spider editor or Visual Studio. Explain to the beginner what is the difference?
``````from scipy.optimize import rosen, differential_evolution
bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
result = differential_evolution(rosen, bounds)
result.x, result.fun
from scipy.optimize import differential_evolution
import numpy as np
def ackley(x):
arg1 = -0.2 * np.sqrt(0.5 * (x ** 2 + x ** 2))
arg2 = 0.5 * (np.cos(2. * np.pi * x) + np.cos(2. * np.pi * x))
return -20. * np.exp(arg1) - np.exp(arg2) + 20. + np.e
bounds = [(-5, 5), (-5, 5)]
result = differential_evolution(ackley, bounds)
result.x, result.fun
print(result.x, result.fun)``````

The result of executing writes.
in the Spider.
spoiler
runfile('C:/Users/zeo/.spyder-py3/s.py', wdir='C:/Users/zeo/.spyder-py3')

in Visual Studio, 2017
spoiler
Press any key to continue

Why?
June 14th 19 at 20:01