The word "chemist" and its origins?

chemist (n.) 1560s, chymist, "alchemist," from Middle French chimiste, from Medieval Latin chimista, reduced from alchimista (see alchemy). Modern spelling is from c.1790. Meaning "chemical scientist" is from 1620s; meaning "dealer in medicinal drugs" (mostly in British English) is from 1745.

Alchemist(n.) 1510s, from Middle French alquemiste, from Medieval Latin alchimista (see alchemy). Earlier forms were alchemister (late 14c.), alkanamyer (late 15c.).

Etymonline.com

Actually they used to produce medicines themselves, and some of them still do it today for simple prescriptions.