How can I mount a one gang box to a pipe?
This question brought to you by Home Depot and their lousy selection.

I do a ton of EMT conduit. Hanging EMT or junction boxes off pipes is completely routine.  

Just from one page on Grainger: 





If the pipe clamps are blind threaded, like two of these are, take care to select sizes that fit the existing holes in your junction boxes, typically 10-32 or 10-24 is safe, sometimes 1/4-20 will work.  And select machine screws short enough they don't bottom out and break the clamp. 

Your friendly neighborhood electrical supply house will have some of these, and other options, in stock. 

Don't use the hole in your junction box that is tapped 10-32, that is for a ground screw. 

I  have also seen people drill and tap holes directly into steel poles, then then simply use machine screws to attach the box.  Obviously the pipe contains no fluid.