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)
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.
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?
I followed this thread 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.
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