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.

Hey @thejkhc

Did you manage to open the scripteditor and delete the value inside “RhinoCodePlugin.RootPath” and if yes, how? I’m currently facing this exact same issue sadly.

For anyone facing this issue in the future, I hope this helps you out, without the need of a clean install:

Close Rhino > Navigate your way to: “C:\Users\AppData\Roaming\McNeel\Rhinoceros\8.0\Plug-ins\RhinoCodePlugin (xxx)\settings” then open the “settings-Scheme__Default.xml” file with a text editor. Remove the path find between: “” and “” did the job. Open Rhino 8 and type “ScriptEditor”, now Python will be reinstalled.

(If this doesnt work, I also removed my “.rhinocode” folder from “C:\Users”, but I expect this to work without removing the folder)

I think it might a bug where when you change the value of the rhinocode inside the Advanced settings, it just disappears from the settings.

1 Like

Thank you. I logged a ticket here to improve this

RH-85856 Reset RhinoCode Folder back to default if target is missing

I just unhid the folder… restarted rhino and it worked… nothing other than that …