I always recommend consulting your doctor before eating any food you may be allergic to. However, you can use sunflower seeds and pumpkin seeds as tree nut-free substitutes for pine nuts in pesto.