algorithmic modeling for Rhino
Hi,
how can i load packages installed with pip/ conda to grashopper?
i would like to use wx module python in grasshopper but i cannout figure how to install and load it into grasshopper.
i have used conda install wx and added path to it
sys.path.append(r'C:\ProgramData\Anaconda2\Lib\site-packages')
but i throws an error
Runtime error (ImportException): No module named _core
Traceback:
line 12, in <module>, "C:\ProgramData\Anaconda2\Lib\site-packages\wx\core.py"
line 17, in <module>, "C:\ProgramData\Anaconda2\Lib\site-packages\wx\__init__.py"
line 7, in script
i have triend to install also Pillow package via pip, but it it will no want to load imagining so i thing i do some mistake in installing python packages via conda,
thaks for help
Tags:
Hi Vladimir, four things:
1) In my experience it is less brittle/easier to simply download, unzip and install Python modules manually (like so).
2) Be aware that some modules aren't compatible with IronPython (numpy/scipy comes to mind) and some use features available in a CPython version that are beyond the current IronPython version (networkx for instance).
3) You should probably use double backslashes when specifying a path in Python.
4) Specifically regarding mx, there are classes/functions for making GUI's in Rhino and .NET that might work for your needs, negating any external dependencies.
Hope that helps a bit :)
Best,
Anders
Hi Anders,
thanks i ll try to go though manual installation.
i want to do a tool that saves screenshot of grasshopper canvas, (Export HiRes image or Export quick image in grasshopper) do you know ith there is direct python command for that or do i need to go through windows capture?
also regarding this topic of python packages, most fiels i find are *.tar.gz how to load those?
I imagine that the Grasshopper SDK might expose the functionality for capturing the canvas, I'm sure David can elaborate on this. Otherwise, you could automate something like GreenShot (which has an API). .NET probably also have some capture functionality.
You just unzip the .gz, then the .tar and extract the folder with the name of the module. So for networkx it would look like this:
And inside this folder:
that is it, i wonder if it works properly, all tiles are ending up in C:\Temp no matter what settings i use in: "gh.GUI.Canvas.GH_Canvas.GH_ImageSettings()" and no picture appears i path i set
Link to the solution for exporting canvas with python:
http://www.grasshopper3d.com/forum/topics/save-grashopper-canvas-as...
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