Rhino 8 Python 3 'from Grasshopper import DataTree' stopped working

Hi all,

This might be something simple I’ve missed, but I’ve hit an issue in Rhino 8 using the Python 3 Grasshopper scripting environment.

I’ve been using this import for a while without issue:

from Grasshopper import DataTree

Earlier today, this worked fine across multiple Python 3 components in my script. After restarting Rhino, the exact same scripts now throw:

ImportError: cannot import name ‘DataTree’ from ‘Grasshopper’ (unknown location)

I am quite new to this all so forgive me if I’ve missed something obvious.

I’ve tried:

  • Restarting
  • Using in IronPython & legacy python (works in both of those)
  • Clearing .rhinocode cache

Any guidance appreciated.

Thanks

There was a similar one recently, but at the moment only finding this older response..

@James_Owen Do you have Grasshopper 2 installed by any chance? If yes make sure to get the latest GH2 as it has a corrected Grasshopper2 top-level namespace and avoids conflict with Grasshopper namespace

Looks like I’m on Grasshopper 1 - I’ll look into this, thank you.