This paper deals with the process of olfactory habitat location in Leptopilina clavipes, a larval endo-parasitoid of fungivorous Drosophilidae. Females show a response to the odour of decaying mushrooms in a state likely to contain host larvae. No long-range attraction to host larvae was detected. Attraction to odours from a different microhabitat (fermenting fruits) was shown to be influenced by different types of conditioning. When reared in hosts on a yeast medium, yeast odours were highly attractive to the emerged adult parasitoids, but mushroom odours were still preferred. Conditioning during oviposition (associative learning) was proven to be much stronger, as it did modify the habitat odour preference-pattern. The ecological significance of the learning process is discussed. It is suggested that the function of learning in search is to optimize the discovery and utilization of resources which fluctuate in abundance and time.