Measuring preferential attachment in growing networks is an important topic in network science, since the experimental confirmation of assumptions about the generative processes that give rise to heavy-tail degree distributions characteristic of real-world networks depends on it. Multiple methods have been devised for measuring preferential attachment in time-resolved networks. However, many real-world network datasets are available as only single snapshots. We propose a novel nonparametric method, called PAFit-oneshot, for estimating the preferential attachment function for a growing network from one snapshot. The PAFit-oneshot method corrects for a bias that arises when estimating preferential attachment values only for degrees observed in the single snapshot. This bias, which had previously gone unnoticed, has a connection with a recently developed conditional inference approach called post-selection inference. Extensive experiments show that our method recovers the true preferential attachment function in simulated as well as real-world networks. Our work opens up a new path for network scientists to measure preferential attachment in a large number of one-snapshot networks that have been out-of-reach until now. As a demonstration, we nonparametrically estimated the preferential attachment function in three such networks and found all are sub-linear. The PAFit-oneshot method is implemented in the R package PAFit.