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
