compas-dev / compas-dev/compas
Rhino scripts default install path is wrong for Rhino 8
- Dominant language
- Python
- Stars
- 386
- Forks
- 122
- Avg merge
- 11d 46m
- Merged PRs (30d)
- 1
Description
`python -m compas_rhino.install` adds the COMPAS packages to `~/.rhinocode/py27-rh8/Lib/site-packages` instead of `\AppData\Roaming\McNeel\Rhinoceros\8.0\scripts`. Grasshopper components cannot then import the modules.
there is a workaround which is to include
```
pt = r"C:\Users\obucklin/.rhinocode/py27-rh8/Lib/site-packages"
if pt not in sys.path:
sys.path.append(pt)
```
at the top of a python component. This fixes IronPython components.
I'm not sure if it's the same problem, but cpython components built with `invoke build-cpython-ghuser-components` do not instantiate on the canvas and result in a `User Object failed to deserialize` error:

Windows 11
Rhino 8 SR6 2024-4-10
COMPAS 2.1.0
Thanks!
Contributor guide
Research direction
Start with the `python -m compas_rhino.install` entry point and reproduce the install on Windows 11 with Rhino 8. Check why packages go to `~/.rhinocode/py27-rh8/Lib/site-packages` instead of the Rhino scripts directory. Done means IronPython Grasshopper components import COMPAS without the workaround and the reported CPython components no longer fail to deserialize.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100