Install required packages if missing