# Compas in rhino8

**URL:** <https://forum.compas-framework.org/t/compas-in-rhino8/782>\
**Category:** compas\
**Created:** [October 31, 2023, 4:14pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782 "2023-10-31T16:14:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lifeisapeachfest](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/lifeisapeachfest/32/692_2.png) [@lifeisapeachfest](https://forum.compas-framework.org/u/lifeisapeachfest)\
**Post date:** [October 31, 2023, 4:14pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/1 "2023-10-31T16:14:07Z")

</div>

Hi,  
interested to know how if I can run compas geometry in rhino8beta?  
I tried to run a simple Mesh.from\_points script in the rhino8 grasshopper script editor and I get an error while importing MeshArtist. (image below: left rhino8 beta right rhino7)

 ![compas_rhino8](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/7a602d5a50caa848e181b6b383ed9b9509c5b8e1.jpeg)

is this because the artist wrapper is for ironpython?

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [November 1, 2023, 8:40pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/2 "2023-11-01T20:40:52Z")

</div>

hi,

yes indeed. currently, `compas_rhino` and `compas_ghpython `only take the IronPython-based script interpreter into account. we are looking into supporting both use cases.

will keep you posted…

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [January 22, 2024, 1:41pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/3 "2024-01-22T13:41:15Z")

</div>

> <https://github.com/compas-dev/compas/pull/1267>
>
> \### What type of change is this?
> 
> \- \[\] Bug fix in a \*\*backwards-compatible\*\* ma…nner.
> \- \[\] New feature in a \*\*backwards-compatible\*\* manner.
> \- \[\] Breaking change: bug fix or new feature that involve incompatible API changes.
> \- \[\] Other (e.g. doc update, configuration, etc)
> 
> \### Checklist
> 
> \_Put an \`x\` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.\_
> 
> \- \[\] I added a line to the \`CHANGELOG.md\` file in the \`Unreleased\` section under the most fitting heading (e.g. \`Added\`, \`Changed\`, \`Removed\`).
> \- \[\] I ran all tests on my computer and it's all green (i.e. \`invoke test\`).
> \- \[\] I ran lint on my computer and there are no errors (i.e. \`invoke lint\`).
> \- \[\] I added new functions/classes and made them available on a second-level import, e.g. \`compas.datastructures.Mesh\`.
> \- \[\] I have added tests that prove my fix is effective or that my feature works.
> \- \[\] I have added necessary documentation (if appropriate)

should be available by the end of the week…

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [January 22, 2024, 7:38pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/4 "2024-01-22T19:38:40Z")

</div>

![Screenshot 2024-01-22 at 20.38.14](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/61885fc4a97be031e10d74d59f07d4a1a9d48a22.jpeg)

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [January 25, 2024, 7:11am UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/5 "2024-01-25T07:11:55Z")

</div>

btw, currently the following combinations work smoothly:

- R8 ScriptEditor CPython + Scene
- R8 ScriptEditor IronPython + Scene
- R8 GH IronPython component + Scene
- R8 GH CPython component + geometry conversions (using the scene doesn’t work here, yet)

---

<div class="post-metadata">

**Author:** ![lifeisapeachfest](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/lifeisapeachfest/32/692_2.png) [@lifeisapeachfest](https://forum.compas-framework.org/u/lifeisapeachfest)\
**Post date:** [February 19, 2024, 8:31am UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/6 "2024-02-19T08:31:12Z")

</div>

yes this works for me as well

 ![test3](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/6e879ade90f9882f709c971ebd7e2a5d757e1e34.jpeg)

---

<div class="post-metadata">

**Author:** ![lifeisapeachfest](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/lifeisapeachfest/32/692_2.png) [@lifeisapeachfest](https://forum.compas-framework.org/u/lifeisapeachfest)\
**Post date:** [February 19, 2024, 8:43am UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/7 "2024-02-19T08:43:44Z")

</div>

how are you able to run it in ScriptEditor without adding the package requirements on top? like below, is there a better way to make rhino import compas?

#r: compas

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 19, 2024, 12:46pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/8 "2024-02-19T12:46:29Z")

</div>

hi,

the instructions for working in Rhino 8 are available here [Working in Rhino 8 — COMPAS](https://compas.dev/compas/latest/userguide/cad.rhino8.html)

---

<div class="post-metadata">

**Author:** ![FilipeJSBrandao](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/filipejsbrandao/32/411_2.png) [@FilipeJSBrandao](https://forum.compas-framework.org/u/FilipeJSBrandao)\
**Post date:** [April 26, 2024, 5:27pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/9 "2024-04-26T17:27:35Z")

</div>

Hello @tomvanmele

After following the instructions to install compas on rhino 8 [here](https://compas.dev/compas/latest/userguide/cad.rhino8.html), compas grasshopper components are still not showing up. Do I need to

> python -m compas\_rhino.install

to have the grasshopper components in rhino 8?

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [May 7, 2024, 10:26pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/10 "2024-05-07T22:26:50Z")

</div>

hi,

we are working to resolve this here.

> <https://github.com/compas-dev/compas/issues/1351>
>
> \`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!

should be fixed reasonably soon…

---

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [May 8, 2024, 5:53pm UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/11 "2024-05-08T17:53:32Z")

</div>

I followed this [thread](https://discourse.mcneel.com/t/new-python-editor-venv/165673/21) and it suggests adding `# env: /path/to/site-package` to the script to enable using that environment in Rhino. After adding this line, there’s no need to use `# r: module`.

I used conda to create an environment with the same Python version as Rhino 8, then installed compas and compas\_fab packages. The `py39-rh8` folder remained untouched in this process.

I tried the code snippet `import compas ... scene.draw()` with the mentioned code and here is the result so far:

- R8 ScriptEditor CPython + Scene: **works**
- R8 GH CPython component + Scene: **No good**

Will this workaround be helpful? I personally prefer `conda` over `pip` since I find it easier to manage environments with `conda` and rollback when something goes wrong. With `pip`, I’m not sure how to achieve that level of flexibility and resilience.

---

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [May 9, 2024, 4:40am UTC](https://forum.compas-framework.org/t/compas-in-rhino8/782/12 "2024-05-09T04:40:40Z")

</div>

Didn’t notice that the GH+scene combination is not working is already mentioned.  
Using `conversions` along with `# env: /path/to/site=package` works on Apple Silicon Mac

As for rhino + scene, I got various results from Intel Mac to ARM Mac. Need further test to verify.

According to the comment in the Rhino Script Editor

> `Use env directive to add an environment path to sys.path automatically`
