pyrevitlabs/pyRevit

[Bug]: pyRevit will not compile on starting Revit

Closed this issue · 6 comments

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

pyRevit will not compile on Revit 2023 & 2024, (although it works just fine on Revit 2020)
Sentinel One is used but not the problem. We worked through that already.
I have tried all of the methods on the Installation issues page, with no luck.
I have also tried a handful of solutions from the forums.

A few weeks ago, after working through the S1 issues, I was able to get v4.8.14.24016 working by completely uninstalling and reinstalling it and several versions of Revit (mainly 2023 and 2024 as those are the ones we use for production.) I recently installed the latest version of pyRevit v4.8.15.24089, only to have it stop working on Revit 23 and 24. Every time I launch one of those versions, I get an error dialog that starts with IronPython Traceback:. This was the same problem I was having with the previous version.

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
File "C:\Program Files\pyRevit-Master\bin\engines\pyRevitLoader.py", line 30, in <module>
File line 24, in <module>
File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessioninfo.py", line 14, in <module>
File Files\pyRevit-Master\pyrevitIib\pyrevit\runtime\_init_.py", line 505, in < module>
Exception: Error dynamically compiling pyRevit runtime

Script Executor Traceback:
IronPython.Runtime.Exceptions.PythonException: Error dynamically compiling pyRevit runtime
at Microsoft.Scripting.lnterpreter.Throwlnstruction.Run(lnterpretedFrame frame)...

♻️ To Reproduce

No response

⏲️ Expected behavior

No response

🖥️ Hardware and Software Setup (please complete the following information)

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.15.24089+0912" | Path: "C:\Program Files\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2025" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "24.2" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "23.1.3" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2020.2.9" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\***\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2025 | Version: 25.0.2.419 | Build: 20240307_1300(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
24.2 | Version: 24.2.0.63 | Build: 20231029_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
23.1.3 | Version: 23.1.30.97 | Build: 20230828_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
2020.2.9 | Version: 20.2.90.12 | Build: 20220517_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020\"
==> Running Revit Instances
==> User Environment
Microsoft Windows 10 [Version 10.0.22631]
Executing User: ***
Active User:
Admin Access: Yes
%APPDATA%: "C:\Users\***\AppData\Roaming"
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
pyRevit CLI v4.8.15.24089+0912.f079f5fd51756b988a06d005d4f4cd2961f36e63

Additional context

No response

/install-fix

Hi @RiverRat205, Try these steps:

  1. Uninstall pyRevit

  2. Delete C:\ProgramData and %AppData%\ pyRevit and pyrevit-master folders

  3. Move all Revit addins to a temporary location. Usual addins locations include:

    • %AppData%\Autodesk\Revit\Addins
    • %AppData%\Autodesk\ApplicationPlugins
    • %ProgramData%\Autodesk\Revit\Addins
    • %ProgramData%\Autodesk\ApplicationPlugins
  4. [Reboot computer]

  5. Reinstall pyRevit

  6. Started each version of Revit confirming pyRevit successfully compiled at startup.

  7. Move all Revit addins that were moved in step 3 back to their original location.
    You may want to add them one at a time and start a revit session everytime to figure out which ones are causing the issue.

sorry for the canned answer, but it is almost always the solution and almost always an addin loading sequence incompatibility.

I appreciate the quick response. I have tried that several times, including just a few minutes ago. I agree that a quick re-install will fix most issues.

another possibility is to rename the pyrevit.addin file to something like 0_pyrevit.addin to load it

That did the trick. Thank you so much.