If you’re getting an error when you try to produce a pdf, or any other output from Lyx using the built in Journal of Physics D style, then try the following:
Download the following file to your home directory: https://www.danbishop.org/downloads-files/iop.tar.gz
Then run the following commands:
sudo tar zxvf iop.tar.gz -C /usr/share/texmf/tex/latex
sudo texhash
Voilà! Don’t even have to restart Lyx 🙂