Only install dependencies when needed