pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.33k stars 338 forks source link

PyRevitLoader - Error Loading pyRevit #1439

Closed kollyboi closed 2 years ago

kollyboi commented 2 years ago

Just installed the pyRevit v4.8.9.21361+0320 Latest admin version with core only. Starting Revit, I get this pop-up:

image

[Window Title]
PyRevitLoader - Error Loading pyRevit

[Main Instruction]
IronPython Traceback:
Traceback (most recent call last):
  File "C:\Program Files\pyRevit-Master\bin\engines\pyRevitLoader.py", line 33, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 288, in load_session
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 222, in _new_session
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 604, in execute_extension_startup_script
AttributeError: Method not found: 'Microsoft.Scripting.Hosting.ScriptEngine IronPython.Hosting.Python.CreateEngine(System.Collections.Generic.IDictionary`2<System.String,System.Object>)'.

Script Executor Traceback:
System.MissingMethodException: Method not found: 'Microsoft.Scripting.Hosting.ScriptEngine IronPython.Hosting.Python.CreateEngine(System.Collections.Generic.IDictionary`2<System.String,System.Object>)'.
   at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Start(ScriptRuntime& runtime)
   at PyRevitLabs.PyRevit.Runtime.ScriptExecutor.ExecuteManagedScript[T](ScriptRuntime& runtime)
   at PyRevitLabs.PyRevit.Runtime.ScriptExecutor.ExecuteScriptNow(ScriptData scriptData, ScriptRuntimeConfigs scriptRuntimeCfg, ScriptExecutorConfigs scriptExecConfigs)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   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.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
   at IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
   at PyRevitLoader.ScriptExecutor.ExecuteScript(String sourcePath, IEnumerable`1 sysPaths, String logFilePath, IDictionary`2 variables)

[Close]
kollyboi commented 2 years ago

Changed the ironpython engine to 2.7.10 due to known issues with:

pyrevit attach master 2710 --installed --allusers

Then I get another error pop-up window:

image

[Window Title]
PyRevitLoader - Error Loading pyRevit

[Main Instruction]
IronPython Traceback:
Traceback (most recent call last):
  File "C:\Program Files\pyRevit-Master\bin\engines\pyRevitLoader.py", line 30, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 24, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessioninfo.py", line 14, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\runtime\__init__.py", line 451, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\runtime\__init__.py", line 305, in _get_runtime_asm
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\runtime\__init__.py", line 297, in _generate_runtime_asm
pyrevit.PyRevitException: Define: REVIT2021;REVIT2021_2
Reference: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll
Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll
Reference: C:\Program Files\pyRevit-Master\bin\engines\IPY2710\Microsoft.Dynamic.dll
Reference: C:\Program Files\Autodesk\Revit 2021\AddIns\DynamoForRevit\Microsoft.Scripting.dll
Reference: C:\Program Files\pyRevit-Master\bin\engines\IPY2710\IronPython.dll
Reference: C:\Program Files\pyRevit-Master\bin\engines\IPY2710\IronPython.Modules.dll
Reference: C:\Program Files\Autodesk\Revit 2021\RevitAPI.dll
Reference: C:\Program Files\Autodesk\Revit 2021\RevitAPIUI.dll
Reference: C:\Program Files\Autodesk\Revit 2021\AdWindows.dll
Reference: C:\Program Files\Autodesk\Revit 2021\UIFramework.dll
Reference: C:\Program Files\pyRevit-Master\bin\engines\IPY2710\pyRevitLoader.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.Common.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.CommonWPF.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.MahAppsMetro.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.NLog.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.Json.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.Emojis.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.TargetApps.Revit.dll
Reference: C:\Program Files\pyRevit-Master\bin\pyRevitLabs.PyRevit.dll
Reference: C:\Program Files\Autodesk\Revit 2021\Xceed.Wpf.AvalonDock.dll
Reference: C:\Program Files\pyRevit-Master\bin\engines\CPY385\pyRevitLabs.PythonNet.dll
C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\runtime\IronPythonEngine.cs(76,26): error CS1705: Assembly 'IronPython' with identity 'IronPython, Version=2.7.10.0, Culture=neutral, PublicKeyToken=7f70
kollyboi commented 2 years ago

Works after running this in a CLI.

pyrevit attach master 2711 --installed --allusers

Closing the issue, but may be useful information to others.