algorithmic modeling for Rhino
I know that the question was already asked but I still struggle with the installation of numpy / scipy on ironpython.
So if anybody have a tips to make it works it would be nice. :)
A tried a lot already but I cannot figure out the problem on step 4. I did every steps describe there :https://stevebaer.wordpress.com/2011/06/27/numpy-and-scipy-in-rhino... and also there : https://store.enthought.com/repo/.iron/ (You should have an account to connect there.)
So I get an error of IO I think, in step 4. It is describe here : (>>> http://community.sharpdevelop.net/forums/t/16072.aspx )
Download and install IronPython 2.7, this will require .NET v4.0.
Add the install location on the path, this is usually:
C:\Program File\IronPython 2.7
But on 64-bit Windows systems it is:
C:\Program File (x86)\IronPython 2.7
As a check, open a Windows command prompt and go to a directory (which is not the above) and type:
> ipy -V PythonContext 126.96.36.199 on .NET 4.0.30319.225
Bootstrap ironpkg, which is a package install manager for binary (egg based) Python packages. Download ironpkg-1.0.0.py and type:
> ipy ironpkg-1.0.0.py --install
Now the ironpkg command should be available:
> ironpkg -h (some useful help text is displayed here)
Installing scipy is now easy:
> ironpkg scipy
Any tips would be nice. Thank's.
I would like to just use one of these prepared binaries, actually:
...which use bizarre "wheel" format installers, needing Pip, which in catch-22 fashion is itself packaged as a .whl file:
...but I have no idea how to point it towards IronPython or the Rhino Python plugin, nor initially even how to install Pip since the instructions ( https://pip.pypa.io/en/latest/installing/#install-pip ) fail using IronPython as "ipy python get-pip.py" which gives an error:
Traceback (most recent call last):
File "get-pip.py", line 17759, in <module>
File "get-pip.py", line 156, in main
File "get-pip.py", line 74, in b85decode
TypeError: sequence item 0: expected bytes or byte array, str found
Learning that wheel archives are merely zip files, changing the extension to zip let me move the numpy folder into the Rhino IronPython plugin folder, in C:\Program Files\Rhinoceros 5.0 (64-bit)\Plug-ins\IronPython\Lib\site-packages, then include that search path in the EditPythonScript editor options, but upon importing numpy I get the same multiarray error mentioned by other users before, and even just importing some part of numpy gives the same error:
Granted, I used the numpy‑1.10.0+mkl‑cp35‑none‑win32.whl which is 32 bit, on my 64 bit Rhino installation. Trying numpy‑1.10.0+mkl‑cp35‑none‑win_amd64.whl despite my Intel instead of AMD processor gives the same error.
Google has many hits for: IronPython multiarray.
You're a lifesaver! Thanks!!
Many thanks to both of you. Have a good day.
Has anyone gotten scipy to work on Rhino/Gh?
I also seem to be missing a bunch of modules from both numpy and scipy. My numpy directory in Anaconda is around 90MB, but my numpy directory in Ironpython is 4MB. Scipy in Anaconda is 300MB but in Ironpython it's < 3MB.
I'm pretty sure that's the reason I can't get scipy to import.
I'm not sure what is causing your import error. However, regarding why the size of scipy in Anaconda is larger than scipy for IronPython -- my understanding is that scipy and numpy contain many packages that are actually wrappers for C and even FORTRAN code and these modules have not been ported over to C# for use in .NET.
Good luck with the import bug!
I'm pretty sure the import error is due to missing modules.
About your hypothesis, your basically saying that what is missing is because it cannot run in IronPython only in standard Python?
For those curious here is a comparison between scipy and numpy in Anaconda vs Ironpython.
Sorry for late reply.
I had a same error... This post would be a solution.
Now I'm wondering how to access Rhinocommon and thus Rhino from outside of the IronPython editors in Rhino or Grasshopper, hinted at here:
That way I could use independent Python 3.5 after installing Numpy/Scipy in the normal way, yet still control Rhino and even access Grasshopper components.
Is this possible?
You can sort of use the commercial PyCharm editor but alas it seems you must still use IronPython as the interpreter so it doesn't solve the Numpy/Scipy library problems:
IronPython 3 was in development, but the whole blog hasn't been updated since 2013 either:
So how do I install Rhinocommon etc. for use with a normal Python 3.x interpreter? This video shows a standard non-IronPython 2.7.3 interpreter evidently being used within the PyCharm editor: