The Labor Department’s consumer price index rose at a 3.4 percent annual pace for the year ending in July, ticking down from 3.5 percent in June, as energy prices held roughly level and housing prices rose only moderately.