Sir William Pym, KCH (1772 – 18 March 1861) was a British military surgeon.
The son of Joseph Pym of Pinley, near Henley-in-Arden, Warwickshire, and elder brother of Sir Samuel Pym, Pym was born in Edinburgh in 1772, and was educated at the University of Edinburgh. He entered the medical department of the army after a brief period of service in the Royal Navy, and was shortly afterwards ordered to the West Indies.
In 1794 he was appointed to a flank battalion commanded by Sir Eyre Coote, in the expedition under Sir Charles (later Earl) Grey which landed at Martinique in the early part of that year. He was present at the reduction of Martinique, Saint Lucia, and Guadeloupe. The force to which he was attached suffered great hardships, but remained healthy until the fall of Fort Matilda completed the surrender of Guadeloupe, when yellow fever broke out in the 35th and 70th regiments, then stationed at Saint-Pierre, Martinique. Pym was ordered to take medical charge through the outbreak, which lasted from 1794 to 1796, when it is estimated that nearly sixteen thousand troops died. Pym thus obtained an unparalleled knowledge of yellow fever.
Pym served in Sicily on his return from the West Indies, and in 1806 he was shipwrecked in the Athénienne between Sicily and Africa. In this wreck 349 persons perished out of a crew of 476, and the few survivors owed their safety in great measure to the activity and resources of Pym. He was transferred from Sicily to Malta, and afterwards to Gibraltar, where he acted as confidential medical adviser to the governor, the Duke of Kent. He was also appointed superintendent of quarantine. He became deputy inspector-general of army hospitals on 20 December 1810, and in the following year the Earl of Liverpool (the Prime Minister) sent him back to Malta as President of the Board of Health, a position he filled with conspicuous success. He returned to England in 1812 and lived in London, but in 1813 he volunteered to return to Malta once again, where the plague was raging. He was appointed Inspector-General of Army Hospitals on 25 September 1816.