The battery must operate for 24 x 365= 8760 hours in one year. Then at an LED current of 20mA the battery capacity must be 8760 x 20ma= 175,200mAh.
Energizer's site lists 20,500mah for their alkaline D cells so you would need 9 in parallel and doubled to get 3V. Have you ever lifted 18 D cells?
A 9V battery has skinny AAAA cells inside that are too small to power an LED for any reasonable length of time.
A red LED needs about only 1.8V so using a 9V battery wastes 7.2V.
Two AA cells (3V) can power a red LED about 5 times longer than a 9V battery, are about the same size and cost much less.
My 3V LED Chaser project uses two AA alkaline cells and its red LEDs blink brightly for about 1 year.