A search is presented for τ slepton pairs produced in proton-proton collisions at a center-of-mass energy of 13 TeV . The search is carried out in events containing two τ leptons in the final state, on the assumption that each τ slepton decays primarily to a τ lepton and a neutralino. Events are considered in which each τ lepton decays to one or more hadrons and a neutrino, or in which one of the τ leptons decays instead to an electron or a muon and two neutrinos. The data, collected with the CMS detector in 2016 and 2017, correspond to an integrated luminosity of 77.2 fb-1 . The observed data are consistent with the standard model background expectation. The results are used to set 95% confidence level upper limits on the cross section for τ slepton pair production in various models for τ slepton masses between 90 and 200 GeV and neutralino masses of 1, 10, and 20 GeV . In the case of purely left-handed τ slepton production and decay to a τ lepton and a neutralino with a mass of 1 GeV , the strongest limit is obtained for a τ slepton mass of 125 GeV at a factor of 1.14 larger than the theoretical cross section.