Do you have to? Maybe I just haven’t run into problems through chance and luck, but I’ve taken prescription meds sometimes in the original container and sometimes mixed in another bottle with other meds and/or vitamins. On long trips, I’ve had up to 5 bottles full of assorted Rx pills and capsules, combined mostly with supplements. I put different distinguishing shapes/sizes/colors in each container, so I could keep them straight.
All containers were together in my toiletries bag, carried on thru Security at every airport. They never resulted in any search because of that arrangement, and I’ve never had any authorities question what substance was in a bottle, or whether it was legitimate, or why there was a combination of pills/capsules/caplets in a particular container. If, for some reason, those containers were singled out and questioned, I’d have to explain more than if everything was in its own labeled container, but it’s never happened, in England, Ireland, France, and elsewhere.
OTC meds, primarily Pepto-Bismol and Imodium tabs, and ibuprofen (which are all either considerably more expensive, or not available in Europe), have been zipped in a small pocket in that toiletries bag - or in a very small separate plastic bottle. Carrying everything in its original container, including shrink-wrapped plastic pouches in the original carton, would take up huge amounts of storage space, that I don’t have available in my carryon-only luggage.
I could understand random pills being questioned, if it ever came up, and perhaps there are actually laws requiring that everything be kept in its proper packaging, but I’ve not encountered any problems.