VSCode python setup Mac with Apple Silicon

Hi there. I’m loving the Python libraries for both Rhino & GH.

I want to use VSCode as my Python editor because the python script editor in Rhino does not meet my requirements.

Is there any official documentation on how to setup/configure both VSCode and Rhino to support VSCode on Mac with Apple Silicon? I’ve had a look at some of the public GitHub repos, however they tend not to work.

You need to setup stubs for intellisense and then you can listen to code:

Code Listener | Food4Rhino
mcneel/pythonstubs: Python stubs for .NET assemblies (github.com)

Hi @Petras_Vestartas, thanks so much for your response.

Most of the doco is for Windows rather than Apple Silicon. Are you aware of any doco that is Specifically for Apple?

Did you try the links and follow the documentation?
I am using compas and stubs (these are just files from rhinocommon) at least works regardless of the os.

My own opinion:
regardless if you are using windows or mac, it is better to wait for rhinocode to be fully developed since using two IDE’s rhino and VScode forces you to shift between two software interfaces regardless of the semi “smooth” integration. After some time you can learn main RhinoCommon methods by heart, and check others in the documentation.

The only thing I think of VScode could be more better is for using Copilot from Github to compensate Python lack of intellisence.

Yes I did try the links and doco, and couldn’t get it to work. Might be worth having another go. :slight_smile:

Have you tried the Rhino Python Code editor for Apple? It’s very limited and doesn’t meet basic coding requirements.

It’s curious that Rhino can’t just look at a file and update a model when the file is updated. A bit like Nodemon.

Why do you mention RhinoCommon? I’m not sure how that would help me with VSCode & Python setup for Mac with Apple Silicon, but I’m curious to hear your idea.

VSCode is orders of magnitude better than the Rhino Python Editor and a standard tool for Python developers.

RhinoCommon is at the basis of the Python integration into Rhino. Rhino 7 uses IronPython, a .NET implementation of Python 2.7. It is made to work with Rhino SDKs via RhinoCommon.

rhinoscriptsyntax is built on RhinoCommon.

Personally I think you’ll be better off directly using RhinoCommon, so that it isn’t unclear what is happening.

Thanks @nathanletwory !
Ok. So I’m not sure what the idea here is.
Are you suggesting to write RhinoCommon with VSCode on Apple Silicon?
C# is not the target language for the development

You can write Python code just fine. I am saying you should use the RhinoCommon SDK/API instead of rhinoscriptsyntax.

I use RhinoCommon in my Python scripts, also in the couple of examples I put up here: https://jesterking.github.io/rhipy/

Thank you for the link. Very interesting. If it’s possible to use Python, VSCode and Rhino I don’t mind using RhinoCommon.

Do you know of any doco to setup VSCode on Apple Silicon for use with Rhino?

The links provided by @Petras_Vestartas should get you started. I believe I have only the stubs installed really. You won’t be able to run Python code in VSCode, that still happens fully in Rhino, but writing the code should be possible.

To be honest, I don’t use the stubs or any other setup for that, since I do the scripts often in Literate programming anyway, so no use for intellisense. I just have a link to the RhinoCommon SDK API handy (Namespaces) at all times.

1 Like