pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

PyRevitLoader - Error Loading pyRevit

Open kollyboi opened this issue 4 years ago • 1 comments

Hi.

I am trying to install pyRevit with the core repository with custom extension with pyrevit CLI v4.8.8.0.

First, I get the same issue as described in issue 1280, then, after doing the trick with the pyRevit-config file I get the following error:

PyRevitLoader - Error Loading pyRevit:

IronPython Traceback:
Traceback (most recent call last):
File "C:\Program Files\pyRevit_core\bin\engines\pyRevitLoader.py", line 30, in <module>
File "C:\Program Files\pyRevit_core\pyrevitlib\pyrevit\loader\sessionmgr.py", line 24, in <module>
File "C:\Program Files\pyRevit_core\pyrevitlib\pyrevit\loader\sessioninfo.py", line 14, in <module>
File "C:\Program Files\pyRevit_core\pyrevitlib\pyrevit\runtime\__init__.py", line 450, in <module>
File "C:\Program Files\pyRevit_core\pyrevitlib\pyrevit\coreutils\assmutils.py", line 98, in find_type_by_name
AttributeError: 'NoneType' object has no attribute 'GetType'

Script Executor Traceback:
System.MissingMemberException: 'NoneType' object has no attribute 'GetType'
at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at IronPython.Compiler.Ast.DynamicGetMemberExpression.GetMemberInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path)
at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str)
at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader)
at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path)
at IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, PythonModule module, String[] parts, Int32 current, List path)
at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name)
at IronPython.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level)
at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path)
at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str)
at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader)
at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path)
at IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, PythonModule module, String[] parts, Int32 current, List path)

This is the BAT-script I use for installation:

%~dp0pyRevit.CLI_4.8.8_signed.exe
path %PATH%;%PROGRAMFILES%\pyRevit CLI
pyrevit detach --all
pyrevit clones forget --all
pyrevit clones delete --all --clearconfigs
pyrevit clone core core --dest="%PROGRAMFILES%\pyRevit_core"
pyrevit configs logs verbose
pyrevit configs checkupdates enable
pyrevit configs autoupdate enable
pyrevit configs rocketmode enable
pyrevit configs filelogging disable
pyrevit configs loadbeta disable
pyrevit configs usercanupdate yes
pyrevit configs usercanextend yes
pyrevit configs usercanconfig yes
pyrevit configs colordocs enable
pyrevit extensions paths add "COMPANY UNCPATH"
pyrevit attach core 2710 --installed --allusers

kollyboi avatar Dec 17 '21 12:12 kollyboi

Seems to be fixed by running this in CLI: pyrevit attach core 2711 --installed --allusers

Should pyRevit be able to detect if IronPython is already loaded in the Revit instance?

kollyboi avatar Jan 03 '22 17:01 kollyboi