Python 3.9 script engine cannot load properly

Hello there, I am unearthing this thread since the problem is occurring again in a really strange way. Here is the situation :
I a have install of Rhino 8 SR11 on my computer, ( I just uninstalled and reinstalled everything to be sure to have a fresh start, i deleted .rhinocode folder and appdata mcneel folders so install should be clean).
I open Rhino, open GH and place a new python 3 script component. It prepares the python engine, creates the .rhinocode folder and everything is fine. This is always the case UNLESS I first save my file.
Example : I open rhino and directly save my empty file, then open GH and create a new python 3 component … that fails with the well known error now : python is not yet ready or failed initialization.

This behaviour does not appear on my other computer but is present on my coworker’s… I’m really lost here.

I link with this the logs of the error in case it helps :

Info 08/28/2024 13:30:59 [RhinoCode] PYTHONHOME: \\?\C:\Users\Thomas.PITIOT\.rhinocode\py39-rh8
Info 08/28/2024 13:30:59 [RhinoCode] PYTHONPATH: 
Info 08/28/2024 13:30:59 [RhinoCode] Loading CPython engine from C:\Users\Thomas.PITIOT\.rhinocode\py39-rh8\McNeel.Python39.Runtime.dll
Error 08/28/2024 13:31:00 [RhinoCode] Error Initializing Python | Error loading CPython engine | System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Python.Runtime.NewReferenceExtensions.Borrow(NewReference& reference)
   at Python.Runtime.Runtime.InitPyMembers()
   at Python.Runtime.Runtime.Initialize(Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize()
   at Python.Runtime.RhinoCodePythonEngine.Start()
   at Python.Runtime.RhinoCodePythonEngine..ctor(String enigneRoot, Int32 major, Int32 minor)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.LoadEngine(CPythonStartupSteps startup) | Inner: System.NullReferenceException: Object reference not set to an instance of an object.
   at Python.Runtime.NewReferenceExtensions.Borrow(NewReference& reference)
   at Python.Runtime.Runtime.InitPyMembers()
   at Python.Runtime.Runtime.Initialize(Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)
   at Python.Runtime.PythonEngine.Initialize()
   at Python.Runtime.RhinoCodePythonEngine.Start()
   at Python.Runtime.RhinoCodePythonEngine..ctor(String enigneRoot, Int32 major, Int32 minor)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.LoadEngine(CPythonStartupSteps startup)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c__DisplayClass109_0.<InitRuntime>b__0(Access access)
   at Rhino.Runtime.Code.Languages.Runtime.Access.Run(String id, Action`1 task)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntime(CPythonStartupSteps startup)
   at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start()
Error 08/28/2024 13:31:00 [RhinoCode] [CPY001] Runtime failed to initialize (Python 3.9.10 (mcneel.pythonnet.python))

Thanks for your help

Huh that’s a weird one. I will investigate :thinking: and report back

Update:

@thomas.pitiot I can not replicate this on my machine no matter how much I tried. I got it logged and will do a deeper look at this:

RH-83556 Python runtime fails init if Rhino file is saved

1 Like

Has this been resolved by any chance? I am trying to bake objects pulled from Revit into Rhino, and I can’t find a solution outside of the Python custom script developed by RiR.

I get this error

''Error 03/05/2025 10:51:58 [RhinoCode] Error Initializing Python | An error occurred trying to start process ‘C:\Users\dfox.rhinocode\py39-rh8\python.exe’ with working directory ‘C:\Users\dfox.rhinocode\py39-rh8’. This program is blocked by group policy. For more information, contact your system administrator.

image

This appears to be a permission issue.

Hi Diana Ofcg,

Can you create a post in the Rhino.Inside.Revit forum category, Content Cache or Elefront (Rhino 7) should work fine in this regard.

Thanks Japhy, I’ll do that!

Hi there,

I ran into a similar issue and can’t find the propper fix in these forums.

“Language Python 3.9.10 (mcneel.pythonnet.python) is not yet ready or failed initialization”

Is there a fix for this? I’m using the latest update of rhino 8

thanks

rhinocode_11612.txt (8 KB)

This looks to be failing on the pip install. Do you have virus software that would block internet access?

 after connection broken by 'ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. 

Yes, is there a workaround that doesn’t require internet access?

Hi Simon, I believe if you disconnect from your network entirely then relaunch Rhino, this will allow for Offline install. Any updates will need to moved over from a jump drive to the machine.

Thanks Japhy, I’ll give it a try

Wow, that was easy, thank you :slight_smile:

1 Like

Info 12/19/2025 07:29:38 [RhinoCode] Storage Site Registered: Local Drive (mcneel.eto.file)
Info 12/19/2025 07:29:38 [RhinoCode] Storage Site Registered: Rhino Files (mcneel.rhinoFiles.file)
Info 12/19/2025 07:29:38 [RhinoCode] Storage Site Registered: Web (mcneel.console.http)
Info 12/19/2025 07:29:38 [RhinoCode] Rhino3D Initialized on Windows - NETFramework
Info 12/19/2025 07:29:38 [RhinoCode] Platform Registered: Rhinoceros 3D @ 8.26.25349.19001 (mcneel.rhino3d.rhino)
Info 12/19/2025 07:29:38 [RhinoCode] Storage Site Registered: Rhino3D Project (mcneel.rhino3d.project)
Info 12/19/2025 07:29:38 [RhinoCode] Operating System: Microsoft Windows NT 10.0.19045.0
Info 12/19/2025 07:29:38 [RhinoCode] RhinoCode server starting on \.\pipe\rhinocode_remotepipe_11568
Info 12/19/2025 07:29:50 [RhinoCode] Language Registered: Plain Text 1.0 (rhinocode.builtin.text)
Info 12/19/2025 07:29:50 [RhinoCode] Language Registered: JSON 1.0 (rhinocode.builtin.json)
Info 12/19/2025 07:29:50 [RhinoCode] Language Registered: Yaml 1.0 (rhinocode.builtin.yaml)
Info 12/19/2025 07:29:50 [RhinoCode] Language Registered: Git DotFile 1.0 (rhinocode.builtin.gitDotFile)
Info 12/19/2025 07:29:50 [RhinoCode] Language Loader Registered: mcneel.pythonnet.python@3.*
Info 12/19/2025 07:29:50 [RhinoCode] Language Loader Registered: mcneel.ironpython.python@2.*
Info 12/19/2025 07:29:50 [RhinoCode] Language Loader Registered: mcneel.roslyn.csharp@9.*
Info 12/19/2025 07:29:50 [RhinoCode] Language Loader Registered: mcneel.gh1.grasshopper@1.*
Info 12/19/2025 07:29:50 [RhinoCode] Language Loader Registered: mcneel.markdig.markdown@0.*
Info 12/19/2025 07:29:50 [RhinoCode] Using existing runtime: CPython 3.9.10/43 (x64)
Info 12/19/2025 07:29:50 [RhinoCode] Initializing CPython 3.9.10/43 runtime
Info 12/19/2025 07:29:50 [RhinoCode] Deploying python packages
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “site-interop.zip”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “utils.zip”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “pylint-2.10.2-py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “pyflakes-2.4.0-py2.py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “pycodestyle-2.8.0-py2.py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “jedi-0.19.2-py2.py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “black-21.8b0-py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “certifi-2024.8.30-py3-none-any.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “pywin32-302-cp39-cp39-win_amd64.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Deploying package from “psutil-5.9.1-cp39-cp39-win_amd64.whl”
Info 12/19/2025 07:29:50 [RhinoCode] Saving CPython runtime configs
Info 12/19/2025 07:29:50 [RhinoCode] PYTHONHOME: \?\C:\Users\zm.rhinocode\py39-rh8
Info 12/19/2025 07:29:50 [RhinoCode] PYTHONPATH:
Info 12/19/2025 07:29:50 [RhinoCode] Loading CPython engine from C:\Users\zm.rhinocode\py39-rh8\McNeel.Python39.Runtime.dll
Error 12/19/2025 07:29:51 [RhinoCode] Error Initializing Python | Error loading CPython engine | System.Reflection.TargetInvocationException: 调用的目标发生了异常。 —> Python.Runtime.InternalPythonnetException: Failed to create Python type for ‪‎‍‌‎‮‎‫‫‎‫‮‎‌‫‌‎‪‫‪‫‌‫‎‫‌‫‮‎‏‫‪‫‪‫​‎‫‎‫‎‌‎‍‫‬‎‏‫‎‎‭‎‎‎​‎‏‫‪‫‫‫‪‫‮‎‎‎‪‎‏‎‬‎‍‫‬‎​‎‫‎‬‎‫‎‭‎‏‫‌‫‌‎‏‎‪‫‍‎‏‫‎‫‮‎‮‎‮‎‍‎‫‫‫‫‍‫‪‫‮‎‌‎‭‎‌‎‪‎‍‫‌‫‎‫‍‎‫‫‍‎‫‎‌‫‮‎‫‫‍‎‏‎‮‎‫‎​‎‬‎‫‫‫‫‌‎​‎‫‫‎‎‍‫‫‎‪‎‎‫‌‫‮‎‪‎‏‎‌‎‬‎‪‎‫‫‌‫‭‎‎‎‬‎‍‫‪‫‬‎‏‫‪‫‬‎‬‎‎‎‪‎‍‫‎‫‮‎‏‫‌‎‫‫‮‎‫‎​‎‭‎​‎‏‎‫‎‫‎‎‎‫ —> System.Reflection.AmbiguousMatchException: 发现不明确的匹配。
在 System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type types, ParameterModifier modifiers)
在 System.Type.GetProperty(String name, BindingFlags bindingAttr)
在 Python.Runtime.ReflectionUtil.GetBaseSetMethod(PropertyInfo property, Boolean nonPublic)
在 Python.Runtime.PropertyObject.CacheAccessors()
在 Python.Runtime.ClassManager.GetClassInfo(Type type, ClassBase impl)
在 Python.Runtime.ClassManager.InitClassBase(Type type, ClassBase impl, ReflectedClrType pyType)
在 Python.Runtime.ReflectedClrType.GetOrCreate(Type type, Boolean reflected)
— 内部异常堆栈跟踪的结尾 —
在 Python.Runtime.ReflectedClrType.GetOrCreate(Type type, Boolean reflected)
在 Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess)
在 Python.Runtime.ModuleObject.LoadNames()
在 Python.Runtime.ImportHook.UpdateCLRModuleDict()
在 Python.Runtime.PythonEngine.Initialize(IEnumerable1 args, Boolean setSysArgv, Boolean initSigs) 在 Python.Runtime.RhinoCodePythonEngine.Start() 在 Python.Runtime.RhinoCodePythonEngine..ctor(String enigneRoot, Int32 major, Int32 minor) --- 内部异常堆栈跟踪的结尾 --- 在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) 在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) 在 System.Activator.CreateInstance(Type type, Object[] args) 在 Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.LoadEngine(CPythonStartupSteps startup) | Inner: Python.Runtime.InternalPythonnetException: Failed to create Python type for <U+202A>‎‍‌‎<U+202E><U+202B><U+202B><U+202B><U+202E>‎‌<U+202B>‌‎<U+202A><U+202B><U+202A><U+202B><U+202B><U+202B><U+202B><U+202E>‎‏<U+202B><U+202A><U+202B><U+202A><U+202B>​‎<U+202B><U+202B>‎‌‎‍<U+202B><U+202C>‎‏<U+202B>‎‎<U+202D>‎‎‎​‎‏<U+202B><U+202A><U+202B><U+202B><U+202B><U+202A><U+202B><U+202E>‎‎‎<U+202A>‎‏‎<U+202C>‎‍<U+202B><U+202C>‎​‎<U+202B><U+202C><U+202B><U+202D>‎‏<U+202B><U+202B>‌‎‏‎<U+202A><U+202B>‍‎‏<U+202B><U+202B><U+202E><U+202E><U+202E>‎‍‎<U+202B><U+202B><U+202B><U+202B><U+202B><U+202A><U+202B><U+202E>‎‌‎<U+202D>‎‌‎<U+202A>‎‍<U+202B><U+202B><U+202B>‍‎<U+202B><U+202B>‍‎<U+202B>‎‌<U+202B><U+202E><U+202B><U+202B>‍‎‏‎<U+202E><U+202B>‎​‎<U+202C><U+202B><U+202B><U+202B><U+202B>‌‎​‎<U+202B><U+202B>‎‎‍<U+202B><U+202B><U+202A>‎‎<U+202B><U+202B><U+202E><U+202A>‎‏‎‌‎<U+202C><U+202A><U+202B><U+202B><U+202B><U+202D>‎‎‎<U+202C>‎‍<U+202B><U+202A><U+202B><U+202C>‎‏<U+202B><U+202A><U+202B><U+202C><U+202C>‎‎‎<U+202A>‎‍<U+202B><U+202B><U+202E>‎‏<U+202B>‌‎<U+202B><U+202B><U+202E><U+202B>‎​‎<U+202D>‎​‎‏‎<U+202B><U+202B>‎‎‎<U+202B> ---> System.Reflection.AmbiguousMatchException: 发现不明确的匹配。 在 System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) 在 System.Type.GetProperty(String name, BindingFlags bindingAttr) 在 Python.Runtime.ReflectionUtil.GetBaseSetMethod(PropertyInfo property, Boolean nonPublic) 在 Python.Runtime.PropertyObject.CacheAccessors() 在 Python.Runtime.ClassManager.GetClassInfo(Type type, ClassBase impl) 在 Python.Runtime.ClassManager.InitClassBase(Type type, ClassBase impl, ReflectedClrType pyType) 在 Python.Runtime.ReflectedClrType.GetOrCreate(Type type, Boolean reflected) --- 内部异常堆栈跟踪的结尾 --- 在 Python.Runtime.ReflectedClrType.GetOrCreate(Type type, Boolean reflected) 在 Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) 在 Python.Runtime.ModuleObject.LoadNames() 在 Python.Runtime.ImportHook.UpdateCLRModuleDict() 在 Python.Runtime.PythonEngine.Initialize(IEnumerable1 args, Boolean setSysArgv, Boolean initSigs)
在 Python.Runtime.RhinoCodePythonEngine.Start()
在 Python.Runtime.RhinoCodePythonEngine..ctor(String enigneRoot, Int32 major, Int32 minor)
在 Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.LoadEngine(CPythonStartupSteps startup)
在 Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c__DisplayClass117_0.b__0(Access access)
在 Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start()
Info 12/19/2025 07:29:51 [RhinoCode] Language Registered: Python 3.9.10 (mcneel.pythonnet.python)
Info 12/19/2025 07:29:58 [RhinoCode] Begin editing Py3 (2d8cfcb8-fd49-44ca-afb4-3151bc77b0cb) as text
Info 12/19/2025 07:29:58 [RhinoCode] Parsing configs schema “https://files.mcneel.com/schemas/rhinocode/editor.schema.v1.json” in C:\Users\zm.rhinocode\editor.json