Importing sklearn in Rhino IronPython


I’ve been working on a program in Rhino which requires the sklearn module which you can import for python applications.

However, IronPython is not compatible with this module. I was wondering if there is a way to bypass IronPython and use my local version of Python instead of the one inbuilt to Rhino.

I understand there might not be a solution to this issue.



You can’t replace the python engine inside of Rhino with another implementation. The two are incompatible. You can always treat your installed python like another application and have your script in Rhino execute python as a child process.

Another option would be to implement one of the .NET machine learning libraries instead. My colleague Mateusz has gone quite far with this (including the Owl Grasshopper plugin). I once did a quick test implementing AForge in IronPython/GHPython based on some of his VB code.

You can call you external python,

You can call for kmeans and import from clr.