I have a code in Julia where I use the function minimize from python. Here I put a simplified example of it works the cose
using PyCall @pyimport scipy.optimize a