The first galaxies contain stars born out of gas with few or no `metals' (that is, elements heavier than helium). The lack of metals is expected to inhibit efficient gas cooling and star formation, but this effect has yet to be observed in galaxies with an oxygen abundance (relative to hydrogen) below a tenth of that of the Sun. Extremely metal poor nearby galaxies may be our best local laboratories for studying in detail the conditions that prevailed in low metallicity galaxies at early epochs. Carbon monoxide emission is unreliable as a tracer of gas at low metallicities, and while dust has been used to trace gas in low-metallicity galaxies, low spatial resolution in the far-infrared has typically led to large uncertainties. Here we report spatially resolved infrared observations of two galaxies with oxygen abundances below ten per cent of the solar value, and show that stars formed very inefficiently in seven star-forming clumps in these galaxies. The efficiencies are less than a tenth of those found in normal, metal rich galaxies today, suggesting that star formation may have been very inefficient in the early Universe.