Compas_rhino setup error: numpy


There are some interesting things happening here: I try to run the compas_rhino examples but I get an error message that numpy cannot be found. It is however already installed (see screenshots).

All this is running on admin rights in my work laptop. My user profile does not work. I have checked in the system environment variables and Anaconda (that contains numpy) is in the PATH.

Are you able to shed some light here please?


The example you show is not to be executed inside Rhino. It is a standalone one, (i.e. needs to be executed on the command line, or from a text editor such as Sublime Text or VS Code).

The underlying reasons for the error is that numpy is installed on your Python installation (aka CPython), but Rhino does not use that, it uses IronPython, which is a completely different beast, one that -among many differences- does not support numpy at all.

As Gonzalo points out, that example is not a compas_rhino example, you can always check this by looking at the top of a script, if it does not require an import from compas_rhino, then you should run it in a standard CPython environment.

Your Anaconda Python environment already has numpy installed, so this is why the pip install doesnt need to do anything. None of the Python numerical packages and example scripts will work in Rhino unless you use features like the XFunc or RPCServer, to bypass the IronPython limitations.