Rhino Python ResetScriptEngine - No module named Grasshopper after ResetScriptEngine

It works fine when Rhino first load but I encountered module not found error after ResetScriptEngine.

image

So in an attempt to get the Grasshopper module to load, I launched Grasshopper, it works again.
My curiosity killed Grasshopper again after I ResetScriptEngine and it stucks until I specifically load Grasshopper using clr.
I haven’t tried with other assemblies. Any thoughts ?

Edit: using Rhino 7 (7.2.21012.11001) on Win10

Hi,
I can’t seem to reproduce this. Do you have exact steps that I can follow?
Thanks.

Python script:

import Grasshopper
  1. Open Rhino, open Python Editor by running command EditPythonScript
  2. Execute code - > no errors
  3. Go to Tools → Reset Script Engine
  4. Execute code → Error message as mentioned
  5. Run “Grasshopper” command
  6. Execute code - > no errors
  7. Go to Tools → Reset Script Engine
  8. Execute code → Error message as mentioned

Error message appears at step 4 and 8, immediately after Reset Script Engine at step 3 and 7.

Hi,

You normally need to load the assembly manually with using clr like you’ve been doing.

it works fine when Rhino first load

That shouldn’t be the case. Could there be something else loading Grasshopper that you’re not aware of?

you are right, I do have something that loaded Grasshopper via clr on startup.
thanks.