Converting the snippet using pathlib.
Feel this is bordering on off-topic, in lieu of a further long comment will add a fix to code snippet in question to convert to pathlib , always happy to spruik for pathlib.
The code snippet shown appears to be written exclusively for MS Windows OS which uses backslashes as path separator.
Please check out the following ...
Go to Edit -> Preferences. In the preferences window click the Input tab. On the top click Keyboard, then check the Emulate Numpad box. Pressing numbers 1 and 3 will switch between front view and side view.
I was able to get in touch with the developer and the fix is quite simple. When installing a blender plugin on macOS you must turn off your browser automatic unzipping
MacOS is doing the unzip for you automatically and that leads to manual error
To do this go to Safari > Preferences > General and then untick the box for Open "safe" files ...