Rhino 8 Script Editor Python Module Search Path missing

By the way, I’m curious, why

#! python 2

with a space between python and 2, but

#! python3

with no space…

Just a typo. Both #! python 3 and #! python3 should work. Same with 2

Hi clement,
Does that mean by extension that adding the module search path in the EditPythonScript just will not include the same path in the python 3 grasshopper nodes?
This seems to be the case but could be that i’m missing something in the set up?
This is a great facility in Rhino 7 and would be a step backwards if it was lost in Rhino 8 i feel.

Hi @alex_leese, only @eirannejad can answer this. Please tell if you’re on win or mac.

_
c.

Thanks for quick reply.
running Windows 11
not too excited about the # env: and # r: solutions just because I write grasshopper solutions for clients and have them set up nicely with the anaconda workflow.

I am using this build: Version 8 SR8 (8.8.24158.3001, 2024-06-06)
I cannot change the script engine by using #! python 3 and #! python 2. The editor will always stay with a certain script engine and tries to execute with it.

I first have to save the file, close the file and reopen it again. Afterwards the new script engine is used.

Am I missing something?

I have plenty of iron python scripts and modules that do not have the line #! python 2. Is there an option to reassign the engine directly?

The cpython Rhino interpreter uses the PYTHONPATH variable of the user and the system to extend the search path by default. Is it possible to add an option in the settings to not do so?

My standard system wide python interpreter is a newer version then Rhino uses and has a lot of additional packages with specific versions and additional custom extensions.