A medicine packing apparatus having a memory (5) that stores shelf numbers of the respective shelf sections the respective kinds of medicines housed in medicine containers. A control unit (6) allows the memory (5) to store the corresponding relationship between the kind of a medicine housed in the medicine container and the shelf number upon attaching the medicine container to the shelf sections. The control unit (6) erases the corresponding relationship from the memory (5) when the medicine container is detached from the shelf. Thus, it is possible to carry out the operations of attaching, detaching and exchanging medicine containers during a medicine packing operation.