Use a lottery. This is what lotteries are for. Allow only individual drivers to hold medallions, set a price or a profit sharing mechanism between city and drivers, rent medallions for five years instead of selling them, and award them according to a lottery.
A lottery would be terrible for this in my opinion, especially for individual drivers. Who would invest in buying a taxi if they could potentially lose their medallion the following year? Not to mention the rediculous position to put a driver in if he loses the lottery next year and then is forced to find a new form of income. Just imagine the implication for any other profession: tomorrow you may lose the programmer medallion lottery and be forced to learn something completely new from scratch. It would be bad for the industry too since churn would happen randomly vs organically, meaning unecessary amount of "green" new drivers who don't know the streets as well, etc.