X=sm.add_constant(X, prepend=True) is not working
Try importing statsmodel.api
import statsmodels.api as sm
I am trying to get the beta and the error term from a linear regression(OLS) in python. I am stuck at the statement X=sm.add_constant(X, prepend=True), which is returning an 

error:"AttributeError: 'module' object has no attribute 'add_constant'"

I already installed the statsmodels module.