Photos library can't be opened because "in use by another program"
I'm experiencing this problem from time to time. For example after I've just added pictures to my Photos.app library and then restarted Photos.app (for whatever reason). The problem seems to be, that spotlight starts doing indexing in the photos library directory and messes up with Photos.app... If you wait for a couple of minutes the problem should go away by itself. In my case restarting Photos.app does not help, restarting my Mac does not help, ejecting and then remounting the external hard drive again does not help either. The only thing that works is waiting.

If your external drive is slow, or if you've added lots and lots of photos it might take longer.