How are proton-antiproton pairs produced?
Before we get to the actual answer, there's something that needs to be clarified about the reaction as you've written it down. The reaction $\gamma\to e^-+e^+$ is not a valid reaction, because it violates conservation of momentum. To see this, consider a photon with energy $2m_e$. Since $2m_e$ is precisely the energy of an electron-positron pair at rest, the momentum of the system is zero after pair production. But since the energy of the initial photon was nonzero, the momentum of the photon was also nonzero. The momentum of the photon is not equal to the total momentum of the electron-positron pair, so this reaction cannot happen as stated (this argument also works when the photon's energy is greater than $2m_e$, it's just more straightforward to see in this particular special case).
To see how pair production actually works, let's look at the reverse reaction: electron-positron annihilation, which is the reaction $e^-+e^+\to\gamma+\gamma$. You can see that, unlike the process you described, two photons are produced by an annihilating electron-positron pair. This means that there's no momentum-conservation issue even when the electron and positron annihilate at rest; the two photons have equal energy and travel away from the vertex back-to-back, so the total momentum before and after annihilation is zero.
Since quantum electrodynamics is time-reversal invariant, the reaction for pair production should look like the reverse of the reaction for electron-positron annihilation. Therefore, the actual process for pair production is $\gamma+\gamma\to e^-+e^+$. But this isn't the way that pair production is usually described (people usually talk about a single photon producing a particle-antiparticle pair). Why is this?
The answer is that the second photon is usually a virtual photon, a mathematical tool used to describe one of the produced charges' interaction with some other nearby charge. Pair production cannot occur spontaneously in a complete vacuum. There has to be some other charged object somewhere in the universe that can carry off the difference in momentum between the initial photon and the electron-positron pair. An example diagram of this process is below:
Fortunately, even in intergalactic space, there's still at least some amount of charge floating around, so this typically isn't a concern, and as a result we tend to omit the other virtual photon when we discuss pair production colloquially.
With that said, there are two essentially unrelated questions being asked here:
Can you produce a proton-antiproton pair from a photon in a way analogous to electron-positron pair production?
The answer to this is yes, it's definitely possible. All you would need is a photon with energy greater than $2m_p$, which is roughly 1.876 GeV, and there would be some chance of it happening. However, a photon with energy that high can also produce a particle-antiparticle pair of anything with electrically-charged constituents that is lighter than a proton, which includes electrons and many types of mesons (e.g. pions). So you wouldn't be guaranteed to see proton-antiproton pair production for a single given photon of this energy or higher, but if you had enough of them, then you would eventually see the process you described happen (the same caveats apply - you can't do this in an empty universe, one of the produced particles has to exchange a virtual photon with some external charge). This process tends to be really rare simply because there aren't really any natural processes that generate photons that have such high energies.
How are proton-antiproton pairs produced?
Probably the most common mechanism, both in cosmic-ray antimatter generation and in the laboratory, is inelastic scattering of a proton off of a nucleus, $p+A\to p+\bar{p}+p+A$. For cosmic-ray protons, $A$ is typically a nucleus in the interstellar medium. For laboratory protons, $A$ is typically a nucleus in some sort of collision target in an accelerator beamline.
A basic rule about antiparticle production is that quantum numbers have to be conserved, that means baryon number, lepton number, strangeness..... This means that in addition to the methods described by probably_someone, collider experiments of e+e- , and the future ones discussed of gamma gamma collisions produce dominantly particle antiparticle pairs of all types, from hadrons to leptons as far as the energy conservation allows. Of course proton antiproton colliders also did that ( but antiprotons are already there!)