pyrevitlabs / pyRevit

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

pyRevit Installed, Does Not Load #1572

Closed DavidWKoch closed 2 years ago

DavidWKoch commented 2 years ago

Describe the bug When starting Revit, instead of the usual INFO window, I was getting a PyRevitLoader - Error Loading pyRevit dialog with the following text:

IronPython Traceback: Traceback (most recent call last): File “C:\Users\dkoch\AppData\Roaming\pyRevit-Master\bin\engines\pyRevitloader.py”, line 33, in File “C:\Users\dkoch\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py”, line 276, in load_session File “C:\Users\dkoch\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py”, line 66, in _setup_output SystemError: Attempted to access an element as a type incompatible with the array.

Script Executor Traceback: System.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array. at Microsoft.Scripting.Interpreter.NewInstruction.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.UpdateAndExecule2[T0.T1.T2,TRet](CallSite site, T0 arg0, T1 arg1) at Iron Python.Compiler.Ast.CallExpression.Invoke0lnstruction.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.FuncCallInstruction'5.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 IronPython.Compiler.Ast.CallExpression.Invoke0lnstruction.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(lnterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at Iron Python.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)

I uninstalled pyRevit and then reinstalled it (pyRevit_4.8.10.22040_signed.exe for reinstall). After the reinstall, pyRevit did not load at all. I followed the instructions here . Initially, there were no attachments, but after verifying that master was listed as a clone, I ran the pyrevit attach master 277 --installed command, and attachments for Revit 2018--2023 were reported. I still get the same PyRevitLoader error.

To Reproduce Steps to reproduce the behavior:

  1. Start Revit
  2. See PyRevitLoader Error Loading pyRevit dialog

Expected behavior I expected pyRevit to load, displaying the INFO screen for a bit, and then to have the pyRevit ribbon tab available in Revit.

Screenshots Screenshots of the PyRevitLoader Error Loading pyRevit dialog and of the command window when checking for attachments and then creating the attachments have been added. PyRevitLoader-ErrorLoadingPyRevit pyrevit attached

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Just noticed that in the output of the pyrevit env command, it thinks the OS is Windows 10 [Version 10.0.22000]. Windows 11 was installed as an upgrade to Windows 10 on this machine. It was not installed from scratch.

DavidWKoch commented 2 years ago

Based on Pyrevit not loading with Microdesk BIMrx add-on #1580, I tried disabling the Microdesk BIMrx add-in and doing so allowed pyRevit to load without error.

I will pass this along to Microdesk. Perhaps they can fix whatever they did in their latest update that steps on pyRevit's toes.

DavidWKoch commented 2 years ago

Microdesk reports that the issue is that their add-in is loading newer versions of certain Microsoft Framework dlls than those used by pyRevit. If BIMrx loads first, the newer versions load and pyRevit fails. If pyRevit loads first, both will load. Microdesk is still testing to see if the older dlls cause any errors with BIMrx commands.

The workaround, for now, is to rename the pyRevit.addin file so that the name is alphabetically before Microdesk.BIMrx.addin, so that it loads first. Changing it to ApyRevit.addin worked for me.

DavidWKoch commented 2 years ago

I have tried installing the latest release [pyRevit_4.8.12.22247_signed.exe], but I still get the same issue with the loading failing when I have Microdesk's BIMrx installed. Renaming the pyRevit.addin file to ApyRevit.addin resolved the issue. Also experiencing an odd effect: after installing pyRevit_4.8.12.22247_signed.exe, if I then install the command line interface [pyRevit_CLI_4.8.12.22247_admin_signed.exe], the pyRevit.addin files are removed (even when renamed to ApyRevit.addin). Has anyone else had that problem as well? I can work without the CLI and with the renaming of the addins.

Avinashhv commented 2 years ago

Have same issue image

Revit version is 2020. Previously version V4.8.8 was working fine

angelmarquez2001 commented 3 months ago

same problem here, with revit 2024