PROBLEM TO BE SOLVED: To provide an injection needle attaching/detaching device of a medicine injection device which prevents fingertips from being pricked by an injection needle erroneously.SOLUTION: An injection needle attaching/detaching device includes: a body case having an opening 12 in which a needle mounting part side of a medicine injection device is inserted, on an upper surface a rotor 13 for needle case mounting provided below the opening of the body case and a motor for allowing the rotor to rotate normally and reversely. In the rotor, a plurality of grooves with which a plurality of ribs protruding toward an outer periphery of a needle case are engaged are provided at predetermined intervals. When a needle mounting part of the medicine injection device is inserted in the opening, the rotor provided below the opening rotates, and thereby, an injection needle can be attached/detached with respect to the needle mounting part of the medicine injection device, and safety becomes extremely high.