Below, the term "cell" to refers to a single flashlight-type battery. The term battery refers to 2 or more cells connected together in either series or parallel.
An easy/inexpensive way to make a battery by connecting cells in series:
1. Lline the cells up in a row on a sheet of paper.
2. Roll the paper tightly around the cells to form a tube and use tape to keep the paper from unrolling.
3. Cut the paper so the tube extends a little longer than half the diameter of the tube past each end of the batteries.
4. Remove about 2 inches of insulation (the length is not critical) from 1 end each of two pieces of wire (i red & 1 black is a good choice, but they can be any color and don't have to be different.).
5. "Wad" the bare part of the wire into a ball.
6. Put a slit in the tube, place a ball of bare wire so it contacts the terminal on the end of the battery and the wire extends out of the slit.
7. Insert a piece of foam rubber in the tube over the ball of wire.
8. Fold the end of the paper so it closes the tube and compresses the foam to hold the wire in place.
9. Use tape to keep the end of the tube closed and the foam compressed.
10 Repeat for the other end.
This may not be the very best solution, but the price is right if you want to use individual cells.
You now have a custom battery with however many cells you wish. If the battery is too long, make 2 or more shorter batteries as described above, tape them together side-by-side and connect them together in series.
Using this method for batteries with cells in parallel requires making a tube with wires attached for each "branch" of the battery, taping the tubes together side-by-side and connecting the wires to form a parallel circuit (all positive terminals connected together and all negative terminals connected together.)
Note: For best results, all cells should be of the same type and manufacturer. A drawback of this technique is that you have to start over each time you need to change the cells. Rechargeable cells, unless your battery has the correct number of cells, will require you to remove the cells of have a custom charger to recharge them.
As mentioned above, some type of secondary (rechargeable) cells are the way to go if you can afford the initial outlay. One drawback is they don't have as large a capacity as many primary (non-rechargeable) cells. The will need to be recharged sooner than the non-rechargeables would need to be replaced.DigiKey
lists 1, 2, 3, 4, 6 D-cell holders. They probably have a minimum order.