You can also allow only a certain app by following guide at: https://stackengineer.com/macos/allow-apps-anywhere.html
This would stop the need from disabling gatekeeper in general.
Go here to get the 'anywhere' option - took me 2 minutes to fix:
1. Open the Terminal app from the /Applications/Utilities/ folder and then enter the following command syntax:
sudo spctl --master-disable
2. Hit return and authenticate with an admin password
3. Relaunch System Preferences and go to “Security & Privacy” and the “General” tab
You will now see the “Anywhere” option under ‘Allow apps downloaded from:’ Gatekeeper options