algorithmic modeling for Rhino
Hey together!
I started to work with numpy for python and It works quit good. My problem is, that I only can use matrices I defined in the python script. When I use the Python component in GH Numpy dosn´t identify the matrices at the input. how can I convert the GH matrices to Numpy matrices? Do I have to rebuildt them? The same when I want a GH matrix at the output. I can print the Numpy matrices but as variable, so that GH can further use them I don´t know how to do it.
Tags:
Hi Apfelbaum
yes, you need to create them from scratch. Grasshopper has no knowledge of numpy, and vice versa.
May I ask you which installation instructions you followed for numpy?
Thanks,
Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com
I followed the two instructions I attached and run all cmd as administrator. The first is from the enthougt webside and the second from a discussion in this forum. Worked well for me.
https://store.enthought.com/repo/.iron/
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 2.7.0.40 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 numpy-2.0.0-1.egg
http://www.grasshopper3d.com/forum/topics/scipy-and-numpy
The issue is that ironpkg cannot access the eggs because this also requires authentication. The reason you were able to install ironpkg (you'll see an egg file was created) is due to that fact that the egg data was in the install file ironpkg-1.0.0.py (see b64eggdata in the file).
1. The installation eggs are located here: https://store.enthought.com/repo/.iron/eggs/
2. Download the eggs and change to your local directory where you download them
3. Run this script in the same directory:
https://gist.github.com/blondegeek/2dbc22360422d0c4b637
as:
ipy IronPython_numpy_scipy.py --install
4. Test with:
ipy -X:Frames -c "import scipy"
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by