The unexpectedly hard very-high-energy (VHE; E > 100 GeV) gamma-ray spectra of a few distant blazars have been interpreted as evidence of a reduction of the gamma gamma opacity of the universe due to the interaction of VHE gamma-rays with the extragalactic background light (EBL) compared to the expectation from current knowledge of the density and cosmological evolution of the EBL. One of the suggested solutions to this problem involves the inhomogeneity of the EBL. In this paper, we study the effects of such inhomogeneity on the energy density of the EBL (which then also becomes anisotropic) and the resulting gamma gamma opacity. Specifically, we investigate the effects of cosmic voids along the line of sight to a distant blazar. We find that the effect of such voids on the gamma gamma opacity, for any realistic void size, is only of the order of less than or similar to 1 % and much smaller than expected from a simple linear scaling of the gamma gamma opacity with the line-of-sight galaxy underdensity due to a cosmic void.