compas-dev / compas-dev/compas

Rhino scripts default install path is wrong for Rhino 8

Open
#1,351 17 comments 0 reactions 0 assignees View on GitHub
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:

![image](https://github.com/compas-dev/compas/assets/55446042/a8cac637-e292-4b60-a312-f7b0147091ab)

Windows 11
Rhino 8 SR6 2024-4-10
COMPAS 2.1.0

Thanks!

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.