Grasshopper

algorithmic modeling for Rhino

Hi everybody!

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 )

1.) IronPython

Download and install IronPython 2.7, this will require .NET v4.0.

2.) Modify PATH

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 2.7.0.40 on .NET 4.0.30319.225 

3.) ironpkg

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) 

4.) scipy

Installing scipy is now easy:

> ironpkg scipy 


Any tips would be nice.  Thank's.

Tristan

Views: 24786

Replies to This Discussion

I was wrong, and on closer viewing of the video, he does switch to the same old IronPython interpreter:

Thus I must conclude that it's a many month or even year waiting game for Rhino/Grasshopper itself to update to Rhino 6/Grasshopper 2 and then possibly also a new Python update on top of that. Even if I could get it to install right, and then work too, no client would ever be able to follow the crazy directions. Numpy/Scipy were merely to be a feather in my cap anyway, since I can just do things with native Python code. Doing without Rhinoscript in favor of pure Rhinocommon vastly simplified my outlook, early on, and now pure Python is my second frugality update, but I'm still interested in using Grasshopper components as a library since that's where the Rhino development action is at these days, including this forum being a huge resource.

IronPython is pathetic abandonware. Please get rid of it, McNeel, and make your system work with normal Python, period. And also include Numpy/Scipy and any other core libraries normal users would use a lot, so normal clients don't have to do convoluted installations that are deal killers since they will usually fail.

While I understand and share the frustration, the whole reason to use IronPython in Rhino in the first place is that it is a .NET language written entirely in C# (enabling us to interact with RhinoCommon etc.). So getting rid of it does not really seem like a solution. Perhaps there could be some clever approaches to run CPython within Rhino/GH in addition to IronPython. Enabling us to implement whichever Python module we might see fit AND get all the sweet functionality of .NET. One can dream :)

The simple alternative is to have McNeel distribute it with Numpy/Scipy already good to go. I mean now that Grasshopper is being used for such thorny math problems by a large user base, any popular library that won't currently work with IronPython easily should already be in there, so normal users can enjoy using simple to understand and modify Python scripts in Grasshopper. VB/C# have too much baggage in the code for normal users to understand let alone modify, whereas Python is trivial. It's arcane technicalities becoming suddenly often inexplicably obsolete that prevents even power users from being able to offer advanced math to clients and forum readers. I can get Numpy to run in an independent IronPython installation but not in Rhino. The number of ridiculous but fatal errors I record above should be a wake up call that here comes Autodesk with their node based Grasshopper knockoff. When I point the EditPythonScript editor at my various IronPython library directories and properly turn on the frames option, it outright fails to import Numpy. Yet there has been no solution offered since it's just something that should work but doesn't, a Rhino bug perhaps?

I could care less about .NET since I don't know a thing about it, but the world of Python computing is open ended and intensely useful except in Rhino where .NET means Python sucks. Interaction with Rhinocommon is based on simple text commands, so what Python is written in should not even matter. What is Python 3.4 written in then and why would it even matter?

That would indeed be great. But saying "any popular library" is a bit of slippery slope, no. I mean where would McNeel draw the line and who should be responsible for implementing/testing etc.? It's a tricky situation that doesn't seem to have a straightforward solution as far as I can gather. To make it even worse, what happens once Rhino is exclusively 64 bit (which it will be soon with Rhino 6) and Enthought (or someone else) has not made Numpy/Scipy available for 64 bit Windows!? Dependencies can be a real headache :/

PS. C# is actually younger than Python and is arguably a simpler/cleaner language to implement on Windows as it is inherently tied to .NET.

PPS. Which lower level language ("A") a higher level language ("B") is written in matters in that it determines how easy it is to fiddle with "A" types/data-structures from "B".

Numpy is an important one since other libraries depend on it, so that's a good start, but most would also want Scipy and Matplotlib too. Most libraries are relatively new whereas Numpy is full of hard to compile routines including Fortran, so a precompiled Rhino/Winows 64 bit is certainly in order.

Seconding this. Python is already the language of choice for data science / machine-learning  (I'm coming to this thread trying to install the scikit-learn library), and not having numpy/scipy is kind of crippling.

To have Numpy and Scipy (and Matplotlib) would be immensely helpful to in pushing forward experiments with ML & architecture.

Here is how it's supposed to work right out of the box for normal users, and thus for everybody, care of my iPhone and the Pythonista app that also comes with a graphical user interface constructor:

xx

Here is a good page that shows what Numpy contains, and a non-IronPython effort called PyPy, to port Numpy to Python:

http://buildbot.pypy.org/numpy-status/latest.html

http://buildbot.pypy.org/numpy-status/latest.html

Ironclad was an attempt to make Numpy work with IronPython, but it too is abandonware on life support:

Ironclad’s purpose is to allow IronPython to transparently import and use compiled CPython extensions.

The original project https://code.google.com/p/ironclad is no longer active. The last known version works with Python 2.6. The idea here is to make it work with current version (2.7.x) of CPython and IronPython.

At the moment it does compile using up to date components and passes almost all internal tests.

Ran 479 tests in 135.893s FAILED (failures=2) scons: done building targets.

numpy is still failing on import.

https://github.com/IronLanguages/ironclad

http://www.johndcook.com/blog/2009/03/19/ironclad-ironpytho/

"The purpose of Ironclad is to allow you to use Python C extensions (of which there are many) from inside IronPython without recompiling anything. The secret purpose  has always been to get NumPy working in Resolver One, and in release 1.4 we finally  achieved this goal. Although the integration is still alpha level...."

What a long story this installation...

Nik Willmore (or anyone) if you finally managed to install numpy for grashopper python, please let me know how to do it. I'm interested in solving simple linear systems of equations and I think Grasshopper math library cannot do, can it?

Thanks! 

I'll try again one of these days, but so far no, I only got it to work in an the independent install of IronPython, got excited about it, but then when I pointed the Rhino EditPythonScript editor via options to the correct directories of the IronPython installation, it failed to work within Rhino and thus within Grasshopper too, since Grasshopper is dependent on the Rhino EditPythonScript editor settings, I was told.

Certainly try it yourself but even the author of a Rhino Python book seemed to say it has gotten too messy to work, since it relied on the minute technical details of the Enthought site package. I also tried some pre-compiled binaries, but I think the 64 bit was only for AMD processors and the 32 bit wouldn't work since I'm on 64 bit Rhino and Windows. All quite uncertain, since there's no manual really.

Hi Lluis,

If you are interested in getting the job done on both 32-bit and 64-bit Rhino, right now a working solution is outlined here:

http://www.grasshopper3d.com/profiles/blogs/using-math-net-numerics...

Thanks

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service