Hello everyone and team of Rh developers,
I searched among some topics to find any possible solution for installing pip packages on gh (Rh8 script component) but couldn’t find any updated ones.
Is there any updates? I’ve noticed that numPy and matplotlib are installed(I think built-in) but how is it possible to add other packages?
I was able to use
pandas by adding it as requirement before importing it:
# r: pandas
Thank you for your answer.
How does it work?
Just # r: pandas? Don’t we need to install it through cmd?
In Rhino 8 when you use a Python 3 script that will do it for you.
But there is red one for me here. Can you explain a bit more specific? I have Rh8.
These are the results I have.
And there is another question that I have! Where is the files directory for pandas? I mean the location for envs or packages? So that I can load it from there.
The error logs should tell you what is going on.
This is what it says: AttributeError: partially initialized module ‘pandas’ has no attribute ‘_pandas_datetime_CAPI’ (most likely due to a circular import)
Oh, I tried to install it from cmd to “site-rhinoghpython” is there a duplicate that causing this problem?
I don’t know enough of the inner workings of the Python 3 integration to be able to tell. That is a question for
This may resolve the issue:
Thank you very much it is completely loaded.
Hello again sir,
I tried to load matplotlib.pyplot.show() to test if other packages are possible to load in gh, but unfortunately after that I couldn’t load pandas again! Can you please kindly check this screenshot and help me again?
What seems to be the problem? I don’t see any errors in script editor
plt.show() doesn’t work for some reason (it works, but the window that should show the plot disappears very fast). You can use plt.savefig() instead, like this example:
For quite some time, I’ve been pondering how to measure time while working on tasks in Grasshopper. Recently, I devised a straightforward logic within Grasshopper that allows me to visualize my work, enhancing my understanding. Perhaps, in the future, this logic could inspire cool projects akin to those on GitHub.
The approach is refreshingly simple. By incorporating a CPython component into Grasshopper, you can create your own refined version. While it’s currently basic, there’s room for impro…
The code runs, but the window that shows the plot appears and disappears in 0.1 second. You can see the icon of it in the taskbar when you run it continuously, but there is nothing to see. It should be in another thread, but when I try to use selenium and especially webdriver.wait(), the grasshopper can’t handle it and freezes.maybe there is problem with external windows.
@sadra Yes external windows need a rhino backend for matplotlib that I have a ticket for to get fixed:
RH-74046 CPython matplotlib needs a Rhino/Eto backend probably (affects pandas)