Is your Library located in your Pictures folder, or do you have it on an external drive? If it's on an external drive, how is your drive formatted? To avoid damaging the Photos Library an external drive must be formatted in either APFS format or Mac OS Extended (Journaled) format. Additionally, the drive can not have had Time Machine on it since it was formatted. There have been so many problems with using incompatible drives that the newest macOSs won't even allow a Library on a non-Mac formatted drive to open, since there is a chance of damaging the Photos database. See this:
Move your Photos library to save space on your Mac - Apple Support
I ask this first, because a wrong format can cause the message that you got. And if this drive is in a an incompatible format, you should stop running Photos with it immediately! A Photos Library can sit on an incompatible drive, but trying to run it may corrupt the database.
If the Library is in an OK place, you can rebuild the it--close Photos and re-launch by option-command-clicking the Photos app icon. It will ask if you want to go ahead. Normally it could take as long as an hour, though I've never seen it take that long.