Installation gets stuck on Mac

Please help! I’m trying to install the Anaconda package on my Macbook M1 (macOS 12.6.3), and every time I try to run the installer package, it gets stuck right at the end when it tries to run the scripts to finish the installation. It says that it should only take a minute or so, but it gets stuck.

Has anyone else experienced this issue and if so, please tell me how you fixed it!