A printing apparatus that facilitates an operation of replacing a printing-agent housing container is provided. In the printing apparatus, when a cover is closed, a LED and a light receiving section can acquire information on whether or not an ink tank is mounted on a carriage. Furthermore, when the cover is opened, the light receiving section can move in a retracting direction from an opening.