Bursts of X‐rays and γ‐rays are observed from lightning and laboratory sparks. They are bremsstrahlung from energetic electrons interacting with neutral air molecules, but it is still unclear how the electrons achieve the required energies. It has been proposed that the enhanced electric field of streamers, found in the corona of leader tips, may account for the acceleration; however, their efficiency is questioned because of the relatively low production rate found in simulations. Here we emphasize that streamers usually are simulated with the assumption of homogeneous gas, which may not be the case on the small temporal and spatial scales of discharges. Since the streamer properties strongly depend on the reduced electric field E/n, where n is the neutral number density, fluctuations may potentially have a significant effect. To explore what might be expected if the assumption of homogeneity is relaxed, we conducted simple numerical experiments based on simulations of streamers in a neutral gas with a radial gradient in the neutral density, assumed to be created, for instance, by a previous spark. We also studied the effects of background electron density from previous discharges. We find that X‐radiation and γ‐radiation are enhanced when the on‐axis air density is reduced by more than ∼25%. Pre‐ionization tends to reduce the streamer field and thereby the production rate of high‐energy electrons; however, the reduction is modest. The simulations suggest that fluctuations in the neutral densities, on the temporal and spacial scales of streamers, may be important for electron acceleration and bremsstrahlung radiation.