How to install libraries like SciPy into Rhino 8 beta script editor?

@eirannejad

Thank you for your response. As I’m fairly new to coding, I’m having a bit of trouble understanding whether it’s possible or not to import the abqpy library into Grasshopper, based on your message.

If it is possible to implement the abqpy library in Grasshopper, do you have any ideas on how I should do it?

OR Would it perhaps be possible to create a Grasshopper component that incorporates the library abqpy through C#, thereby bypassing GhPython?

It’s not possible to import abqpy and get it to work correctly as it is, without a lot of further work.
I think it would be possible to create a fork of abqpy that works inside a Grasshopper Python 3 component.

I don’t like to say anything is impossible in Python, but incorporating one closed-source proprietary environment inside another (on a closed-source proprietary operating system) is the worst case scenario, even with Python to help. I have run an open-source application from Grasshopper before, and that would work with any command line application (basically just call subprocess.run on it).

If the __main__ import config process is the only problem to be solved, perhaps it only requires a week or two’s work. Without knowing more about how Abaqus has changed since 25 years ago (it requires a license, or at least requesting a demo from 3DS) that could easily stretch into months however.

All is not lost though. 3DS and Abaqus do not have exclusive rights to the Finite Element Method. There are other great FEM frameworks for Grasshopper and Rhino.

Also, I’d have thought it’s possible to import Abaqus meshes into Rhino somehow (even if via .dwg for example). They used to be simple node and edge lists.

It seems the python Rhino 8 uses is located under:
image

But unlike normal venv, there’s no “active” script inside the Scripts folder. Not sure how we can enter the env and install customized packages… Perhaps McNeel doesn’t want us to do sth like this as more bugs may appear?

Got this answer:

I feel like I am coning late to this forum but thanks to the content I have been able to get all my python advanced libraries up and running. I desired to figure this out in the summer of 2021 with the ghpython-remote node but here it is for what it is worth. Thankyou everyone on this forum and at McNeels.

Passionately curious, Michael Wickerson, Wickerson Studios

Youtube Instructional Tutorial: Machine Learning Python 3.0 Libraries into Grasshopper
link: How to Load Python 3.0 Libraries into Grasshopper for Rhino8 Script Editor Node (youtube.com)

4 Likes

Update:

Oh actually I’m part of the team behind Giraffe it does exactly what you need it’s currently user object files but you if a few day we will make a full-fledged version.

I tried installing scipt inside cmd like below

pip install scipy --target system path

after which I tried to import scipy in Rhino8 python with below code:

import sys
sys.path.append(“C:\Users\Lenovo\.rhinocode\py39-rh8\Scripts”)
import scipy

But I get below error. Also tried reinstalling scipy but doesnt help:
Error running script: The scipy install you are using seems to be broken, (extension modules cannot be imported), please try reinstalling. [3:1]

Anyhelp would be highly appreciated!

Thanks,
Anand

Hi Anand,

Please see the documentation in these regards

Hi Japhy,

It works for me now, once I cd to the correct Rhino8 directory. Thanks.

1 Like