I am trying to create my own app based on Grasshopper script.
I tried to follow the tutorial. In particular, I can generate the interface, but when I click on 'Run Grasshopper, this error message appears on PyCharm:
Okay, could it be the case that you installed the packages using the pip install compute-rhino3d in a virtual environment within your IDE?
You could try and test the run_grasshopper.py file more thoroughly by running it through the command line. To do that open a command window (type cmd in your windows menu) and in that command window navigate to the folder where the .py file resides (cd "C:\Users\<your_name>\viktor-grasshopper") and then run the file (python run_grasshopper.py)
I suspect that should return the same error, in that case, try installing the two packages in the same command window and re-run the test
Could it be possible that either Rhino or Grasshopper is not running at the moment youโre testing your script? As stated in the tutorial (Tutorial - Integrate Rhino/Grasshopper | VIKTOR Documentation) both need to be actively running in order to test the run_grasshopper.py script.
Also, pay close attention to step 2 of the Hops installation (Tutorial - Integrate Rhino/Grasshopper | VIKTOR Documentation). The recommendation is to uncheck the Hide Rhino Compute Console Window, which makes it easier to see when it is or is not running.
I did the hops, created the Rhino/Grasshopper folder, ran run_grasshopper.py. And then I did the worker step up, and apparently, itโs working. I can launch the application, but when I press the run grasshopper button an error appears, and the input.json file disappears from the viktor-grasshopper folder.
Hi @Daniel, Iโve certainly overcome this problem by now, but I have a question. How do I get the data from GeoPolygonField into my model in grasshopper?
@Elias how did you solve it? I am facing the exact same issue! and when I run the .py file in the cmd inside the folder it runs. but on the worker is shows the same error
import compute_rhino3d.Grasshopper as gh
ModuleNotFoundError: No module named โcompute_rhino3dโ @Daniel is there a solution for this?
Hi @Daniel I did the step from the installation guide through the cmd command line as described in (Tutorial - Integrate Rhino/Grasshopper) I am running Python 3.10.8
pip install in Windows Powershell. No local environments, and I make sure that rhino 7 and GH are open