I am new to plugin development using the Script Editor, and have followed both the guide by @eirannejad and the tips on this thread Grasshopper Plugin running Python - #6 by eirannejad in order to package a few python3 components as a plugin to be distributed to students for a workshop.
The components run on a venv and use dependencies such as Pandas, Numpy, Scipy, XLRD, Matplotlib and Seaborn. The problem is :
Compiling the plugin without the python libraries is quick, but they don’t work as they miss the python libraries (duh.!)
Adding the python libraries to the project (as one should , by pointing to the packages here C:\Users\USER\.rhinocode\py39-rh8\site-envs\RAW-OJ5x0e2P) and the Script Editor freezes on “preparing python libraries” and never compiles. It has been left overnight (10hours) and same progress bar.
I have tried adding only one of the libraries ( and not all 20+ of them) and i get the same problem. it is stuck on “preparing assembly” even though the logs says
Info 10/17/2025 08:42:24 [RhinoCode] Stubs already exist for Microsoft.VisualBasic.Forms, Version=8.0.0.0
Info 10/17/2025 08:49:43 [RhinoCode] Added library Rhino.Runtime.Code.Languages.PythonNet.CPythonModule to active project
Am i doing something wrong ? is there a bug ? Any help is much appreciated
I upload screenshot as well as the logs. Running Rhino 8 SR22 2025-8-5 (Rhino 8, 8.22.25217.12451, Git hash:master @ 96429e6361004c775c
update: i have tried not adding the libraries at all and using #r in each component instead of the #venv, the plugin compiles but the components dont work, as if the libraries are not loading - and therefore a dataframe is not recognized as such
What do you mean by “compiling” when you say “Compiling the plugin” and “the plugin compiles”?
CPython components don’t need to be compiled. They might just need their depenencies installing into a venv. It’s possible to compile IronPython components that only use Pure Python code, but it’s a lot of work, and won’t work with C extensions.
They don’t need to be, but CPython components can be compiled, just the way that was shown in the Post/Tutorial linked by Gabriella.
As for the issue: Unfortunately can’t offer a fix besides the “known ones” (i.e. delete .rhinocode completely and re-initialize, which did not work for me).
But I can confirm similar issues with freezes and/or things getting stuck during Compilation as well as during # r: installations.
Over here, package installs freeze Rhino completely. If the process is killed, the package is actually installed. It seems Rhino never exits the installing package mode, which seems similar.
EDIT!
I picked up a hint from this thread, with which I could at least solve the installation-freeze issue! It seems to be charset_normalizer. I had an environment like this:
…my environment installs without a problem! Maybe this works for your case, too? You mentioned you had around ~20 dependencies, so maybe one of them has charset_normalizer as requirement?! It’s just a hunch!
I hope @eirannejad might be able to shine some light on this, as we are also in the process of deploying for upcoming student workshops