out of pure necessity
He sold the house out of pure economic necessity.
—Why did you accept that job? —Out of pure necessity.
She learned to sew out of pure necessity, not for enjoyment.