Preheat the oven to 180C.
Peel, core, halve, then slice the apples and put them into a bowl. Add the sugar, spices, ground almond, vanilla and flour. Toss well and set aside.
Unroll the pastry, and carefully place it over a 20-22cm pie tin. Line it with the pastry, trimming the edge around the tin. You might need to cover small areas, where the pastry hasn’t covered properly or got torn - use any leftover pastry for this. Put the dish in the fridge.
Make the crumble. Tip the flour, ground almonds, sugar into a bowl, then rub in the margarine using your fingers until the mixture resembles breadcrumbs.
Take the dish out of the fridge. Arrange the apples in the pastry-lined tin, then scatter over the crumble, pushing it down slightly with the base of a spoon.
Bake in the middle of the oven for about 35 mins until the topping is golden. If you want almonds on the top, scatter these on top of the pie after 30 minutes of baking.
Let the pie rest for 10 minutes, then serve warm. Or let it cool completely and cut it into slices.