I haven't seen that problem before. Since at this stage in the process the code that's running is just standard Moodle, not the code in the plugin, it would seem like an issue with your Moodle install. Have you tried installing any other Moodle question type plugins from zips?
Hello, Thank you for your quick response. I tried to install a few other plugins but the result is the same. I thought the problem is with my moodle installation and tried installing on another device with windows and it took hardly 10 mins. I think there is some problem with moodle installation on mac OS.