With rhinoinside, Import Rhino could not be resolved

I want to use Hops and rhinoinside, but I’m not having luck so far.

I followed the video found on the page

I copied the python Hops code at the end of the video that uses rhinoinside. It says, Import “Rhino” could not be resolved Pylance.

I also tried Flask, using rhino3dm. I can create an object but I don’t know how to add the object to the doc. rhinoscriptsyntax import also fails.

sphere = rhino3dm.Sphere(mote.pt, radius)
rhinoscriptsyntax.doc.Objects.AddSphere(sphere)

I have Rhino 7 and Visual Studio 1.72.2

Could it be a configuration issue?

What version of CPython are you running? The current implementation of Rhino.Inside.CPython requires CPython 3.8

Also, did you pip install rhinoinside?

Hi Steve,

Thanks for the quick response.
I have python 3.10.8
and I did pip install rhinoinside.

-Paul

Also, I have Rhino 7.23. On your page, it says Rhino 7.4 is required, but I couldn’t find 7.4 anywhere

You really need to make sure you do this work with Python 3.8. That is a hard requirement for Rhino Inside to work.

I just uninstalled java 3.10 and installed 3.8, along with all the stuff required for hops. Now, the Import Rhino works when I run the python script from within the Grasshopper Python editor, but import Rhino fails when editing using Visual Studio. Therefore, there must be some configuration of Visual Studio that I’m searching for

I guess you are trying to do this on a Mac? Rhino Inside technology is for now Windows-only.

Python 3.10 no doubt?

Visual Studio Code, right?

Yes - Visual Studio Code, python 3.8, I have tried with Rhino 7.23 and Rhino 8 WIP

I don’t think it’s related to rhinoinside. When I try any python script in VS code (with or without rhinoinside), the imports fail. I tried installing all extensions in VS code that had anything to do with Rhino, but no luck.

I’ve tried everything to configure Visual Studio Code, but it refuses to find Modules System and Rhino. It must be something something simple that I’m not seeing.

I went through the instructions to set up VS code - https://marketplace.visualstudio.com/items?itemName=designtoproduction.rhinopython
and VS code now finds Rhino and System modules

However, I’m still having trouble getting the modules rhinoscriptsyntax and scriptcontex
Any suggestions? Tx

Also, I’m doing all this on Rhino 7.23. your documentation says I need Rhino 7.4 but

Hi Paul -
I’m afraid I can’t help you with the rest of this, but…

That would be the minimum required version. Not only that specific version.
-wim