Loading Grasshopper Document from Rhino Python Editor breaks print function

I’m having trouble properly wording the title for this, but I can explain further here. I’m working on a rhino command (written in the rhino python editor) that uses the “Grasshopper.OpenDocument()” function to load and then access a grasshopper document from my hard drive. However, it appears that, if this grasshopper definition has ANY GHPython components within it, the print function stops working (no longer outputs to the rhino python editor console), as well as a series of other issues that I assume are related to this. I made some attempts at reloading the scriptcontext in the rhino python editor after working with the GH definition but that doesn’t seem to make a difference.

Basically it appears that loading a python script in ghpython while a another python script in rhino python is still active is whats messing things up. I was hoping to get some insight on whether or not there is a way to work around this? I appreciate any help.

So, I have since found other threads that bring up a similar issue.

I have also found a workaround (sort of) by compiling a GHPython script into a GHPY grasshopper component, in which case it doesn’t seem to have any effects on the print function of the rhino python script. Maybe this could provide some insight into whats causing this issue? I will keep this thread updated if I have any other findings.