No building or land shall hereafter be used or occupied and no building or part thereof shall be erected, moved or altered except in conformity with the regulations herein specified for the district in which it is located, and without first obtaining a building or occupancy permit, except as hereinafter provided. In the enforcement of the provisions of this chapter, the building inspector may withhold building or occupancy permits until all provisions of this chapter are complied with or his decision is appealed to the building board of appeals.