I was using optimize from scipy for logistic regression. I have installed scipy using pip install scipy. The installation was successful but on running the code I
pip install scipy