Rhino 8 change Python 3.9 installation path

Hello,
We have updated to Rhino 8 at our company, however our coworkers can’t use the new Python 3 scripts feature. When they try it, they get the following error message:

Language Python 3.9.10 (mcnell.pythonnet.python) is not yet ready or failed initialization.

By checking the error logs, we identified that Python in Rhino is blocked by group policy (see logs below). I have talked with our IT and they mention that this is a security policy at the User folder level.

My question:

  • Is it possible to configure the installation path for .rhinocode\py39-rh8\python.exe? For example, to setup the installation at C:\ProgramData\.rhinocode\py39-rh8\.

Logs

Info {date} [RhinoCode] Initializing CPython 3.9.10/43 runtime
Info {date} [RhinoCode] Configuring runtime@py39-rh8 for the first time on X64
Info {date} [RhinoCode] Deploying CPython 3.9.10/43 runtime
Info {date} [RhinoCode] Clearing exiting runtime
Info {date} [RhinoCode] Successfully uninstalled existing runtime at C:\Users\{user}\.rhinocode\py39-rh8
Info {date} [RhinoCode] Installing pip
Info {date} [RhinoCode] Running process: C:\Users\{user}\.rhinocode\py39-rh8\python.exe get_pip.py --no-warn-script-location pip setuptools wheel
Error {date} [RhinoCode] Error Initializing Python | An error occurred trying to start process 'C:\Users\{user}\.rhinocode\py39-rh8\python.exe' with working directory 'C:\Users\{user}\.rhinocode\py39-rh8'. This program is blocked by group policy. For more information, contact your system administrator.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at Rhino.Runtime.Code.RhinoCode.RunProcess(String filename, String args, CancellationToken token, Action`1 processConfigurator)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.RunPython(String arguments, CancellationToken token, Action`1 processConfigurator)
   at Rhino.Runtime.Code.Languages.PythonNet.Attributes.RuntimeBinariesPackage.Deploy(CPythonRuntime runtime)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeployCPythonRuntime(CPytho

@RaulCz Welcome to the forum!

By default Rhino3d initializes the Python 3 environment under .rhinocode in user profile.

Here is the guide on changing rhinocode root path:

1 Like

Thank you very much!

Hi Ehsan,

I am having the same problem, however I can’t located this Rhinocode root path in the Advanced tab.

Open ScriptEditor once. I think that is needed for the option to show up on the first launch

How do i reset the RhinoCode root? I think I broke it.
Access to the path ‘C:\Program Files\Rhino 8\System~.rhinocode\py39-rh8\logs’ is denied.

edit
I am just doing a repair via the installer.
– it appears to not have fixed the modification I made.

I am unable to call up the RhinoCode in the Advanced list.

Priority: AssemblyPriority
{
Access to the path ‘C:\Program Files\Rhino 8\System~.rhinocode\py39-rh8\logs’ is denied.
UnauthorizedAccessException
}

this appears when I try to open Grasshopper

note I attempted to uninstall and reinstall to no avail.

Hi @thejkhc ,

To change the scripting root directory back to default, clear the override set on RhinoCodePlugin.RootPath in Advanced options.

Does this help?

That’s my issue, I can’t get that option to appear again. If I could I would have done so @pedrocortes @eirannejad

I clean installed Rhino, and I discovered that the folder with py3.9 is defaulting to being hidden. When I unhid it it seemed to have resolved the permissions issue.

@eirannejad @pedrocortes your scripting languages initialization support doc needs to add this hidden folder issue. It seems to be the culprit of the initialization of the language in Script Editor

I have the same problem.How do we fix this? :joy:

Hellow. I try input "_scripteditor"in rhino and then can find the named RhinoCodePlugin in advanced options.You could try it.