I have imported a python script into grasshopper and connected it to a g-code compiler and keep running into errors.
Your filepath does not match. It’s searching for your .py file in the rhino system directory. You should either not override it(like you did in the last picture), or supply the full path to the open function (in the last picture).
Generally, you should read the comments and error messages (more carefully) to understand what is happening.