Help using Conda package in RhinoCode

@eirannejad I would like to import the grass package from conda-forge. You had suggested trying conda_interop, but I’m having trouble. The grass package is only for Mac and Linux currently, so I’d like to install and activate the environment on Mac or WSL. Any advice would be most helpful.

import rhinocode
import conda_interop as ci

env = r"\\wsl.localhost\Ubuntu\home\baharmon\miniconda3\envs\grass"
ci.append_env(env)

But I get the error system cannot find the path. Any advice?

Note, I also tried on Rhino 8 for Mac, but got the error:

  File "/Users/baharmon/.rhinocode/py39-rh8/site-interop/conda_interop/__init__.py", line 18, in append_env
    os.add_dll_directory(op.join(conda_env_path, r'Library\bin'))
AttributeError: module 'os' has no attribute 'add_dll_directory'

I should also note that Conda Python interpreter paths on Mac and WSL are in bin/python, not Library\bin. Should I try adapting this approach you suggested to @Petras_Vestartas, but change the path? What exactly should the path point to? The interpreter? The site packages?

Thanks, Brendan

FYI There are official Windows builds of Grass

Do you need the Conda Mac or Linux build in particular?

Yes, I would like to use the Conda distribution of GRASS. GRASS is only available as a Python package through Conda rather than Pip, because of its dependency on GDAL. My long-term aim is to develop a CPython addon for GRASS in Grasshopper. In particular I would like to implement GRASS tools for lidar and raster processing in Grasshopper by handling the rasters as Numpy arrays that can be modeled / rendered in Rhino as meshes or point clouds.

@James_Parrott The Windows binary is for GRASS as a desktop GIS; in this case I’m interested in GRASS as a Python library that I could import in CPython script components in Grasshopper.