It is usually inappropriate to post large slabs of code, please see the forum guidelines.
Have you been able to install other plugins ?
What does the webserver error log say ?
Suggest that you install the plugin manually. It is common for localhost installs to not have the file permissions to write to their own files, this is often not worth the trouble of fixing, rather you just manually install and update core + themes + plugins.