Numpy and Scipy in RhinoPython

Disclaimer: I have very little experience with numpy and scipy so you are going to do better by searching google for support with these libraries. This blog is about getting these libraries to run in Rhino.

Yes it is possible now!!!
Okay, here’s what I did to get numpy/scipy running in Rhino

1 – Install Rhino 5 (32bit version)
numpy/scipy uses C++ DLLs which need to be compiled for a specific platform. Currently numpy/scipy for IronPython will only run in 32bit applications on Windows. I contacted the guys at Enthought and they do plan on releasing a 64bit version for Windows, but they want to make sure everything is working on 32bit first. They have some doubts about being able to release a mono version for you Mac guys out there.

3 – Modify settings in RhinoPython
Start Rhino 5 – 32bit version and run “EditPythonScript” to bring up the editor. Go to the options dialog by selecting Tools->Options from the menu

Add site-packages and DLLs to the search paths (see image). This helps RhinoPython find the numpy/scipy packages and associated DLLs.

Check the “Frames Enabled” option since numpy/scipy requires this to be turned on.
I decided to make the “Frames Enabled” an optional engine feature since it does have a performance impact on scripts. Numpy/scipy requires this feature to be turned on.

Hi! I am trying to follow the instructions on http://www.enthought.com/repo/.iron/, but I want to install it for ironpython and the instructions appear just for python. Any ideas how to install iron_setup.py? I am trying

ipy iron_setup.py build

but getting errors:

error MSB4019: The imported project “c:\Microsoft.Cpp.Default.props” was not found

Hi Steve, Thank you so much for the tutorial. I managed to install numpy and scipy on rhino 32-bit. Now, I am trying to install pyhull too for convexhull calculations. Do you know how to do this? Thank you so much

Thank you for the super quick reply. I have tried that link but no luck on how to install it. The reason I am doing that was because the spatial module of scipy doesnt appear for my on Rhino Python. Or am I doing something wrong when importing scipy into python? Thank you!

Hi Steve
Thank you for the tutorial … i tried to add numpy to my rhino python but every time i run the script the following error appears, both on 64bit and 32bit versions:
Message: Could not add reference to assembly mtrand

I checked the paths added to the “Module Search Paths” and it seems that nothing has been added to the folders after installing Canopy. Is this the problem and should i add numpy folder to the location manually?