Hi! I’ve noticed that i cannot run python code-blocks inside of dynamo when i have pyrevit installed. I’ve been trying in Revit 2023,2024, and 2025. I get the error below, and as soon as i uninstall pyRevit , everything runs fine. Have anyone experienced this before, or know how to solve it? See the code i’ve used to reproduce the problem below (it does not have to be that code specific but rahter anything that tries to interact with the api). Moreover, it seems to somehow be related to CPython3, since it works fine in IronPython in Revit 2023. - I’ve also posted on the dynamo forums, where the suggestion was to remove all other addins and do a fresh install of pyrevit then try again. Unforunately, this did not help. Been trying with pyRevit 5.0.1
Error:
SystemError: returned a result with an error set [’ File “”, line 8, in \n’]
import sys
import clr
clr.AddReference('RevitServices')
clr.AddReference('RevitNodes')
clr.AddReference('RevitAPI')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
categories = [BuiltInCategory.OST_DoorTags, BuiltInCategory.OST_WindowTags]
out_list = []
out_elements =[]
for category in categories:
collector = FilteredElementCollector(doc).OfCategory(category).WhereElementIsNotElementType()
out_list.append(collector)
out_elements.append(collector.ToElements())
OUT = out_list, out_elements
Jonn.O
(Jonn Øyvind Hosum)
April 23, 2025, 10:10am
2
It’s a known issue, with no solution so far unfortunately.
opened 03:40PM - 11 Sep 24 UTC
Bug
Heisenbug
### ✈ Pre-Flight checks
- [X] I **don't have SentinelOne** antivirus installed … (see above for the solution)
- [X] I have **searched in the issues** (open and closed) but couldn't find a similar issue
- [X] I have **searched in the [pyRevit Forum](https://discourse.pyrevitlabs.io)** for similar issues
- [X] I already **followed the [installation troubleshooting guide](https://pyrevitlabs.notion.site/Installation-issues-f6495adb56254e9e8021f8a68e3b2ab7) thoroughly**
- [X] I am using the **latest pyRevit Version**
### 🐞 Describe the bug
All the computer of the office where I work have issue with executing python dynamo nodes since pyRevit is installed on their computer.
### error messages
These are the errors that popup from their Dynamo:

(this pops up as soon as the python node is called)

(this pops up is the user does some operation, for example, change the engine to IronPython2 and then revert to CPython)
### further info
- The issue only occurs if the engine used by Dynamo is **CPython**. With IronPython 2 everything works just fine.
- the script inside of the screenshotted python node is `OUT=IN`
### researches
I read a similar issue unfortunately closed without answers: [Errors in Dynamo Python Script.](https://github.com/pyrevitlabs/pyRevit/issues/1735)
### ⌨ Error/Debug Message
```shell
attempt to read or write protected memory.
```
### ♻️ To Reproduce
just open Dynamo and create python node
### ⏲️ Expected behavior
CPython in Dynamo should work properly
### 🖥️ Hardware and Software Setup (please complete the following information)
```shell
Windows 11
$pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
pyOMA | Deploy: "core" | Branch: "master" | Version: "4.8.16" | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
==> Attachments
pyOMA | Product: "24.2" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
pyOMA | Product: "23.1.3" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
pyOMA | Product: "Autodesk Revit 2021" | Engine: DEFAULT (2711) | Path: "C:\Users\gdotto\AppData\Roaming\pyOMA"
==> Installed Extensions
DDeT | Type: Unknown | Repo: "" | Installed: "\\office-server\DDeT.extension"
pyOMA | Type: Unknown | Repo: "" | Installed: "\\office-server\pyOMA.extension"
pyRevitCore | Type: UIExtension | Repo: "" | Installed: "\\office-server\pyRevitCore.extension"
pyRevitTools | Type: UIExtension | Repo: "" | Installed: "\\office-server\pyRevitTools.extension"
==> Default Extension Search Path
C:\Users\gdotto\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\Users\gdotto\OneDrive - Office for Metropolitan Architecture\Documents\GitHub\myPrivate
\\office-server
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
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\"
Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
==> Running Revit Instances
PID: 3860 | 24.2 | Version: 24.2.0.63 | Build: 20231029_1515(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2024"
==> User Environment
Microsoft Windows 10 [Version 10.0.22631]
Executing User: OMA\gdotto
Active User:
Admin Access: No
%APPDATA%: "C:\Users\gdotto\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.16.24121+2117.23a0b8cbc4babdeb29a0611e159d017bbe9cbad5
```
### Additional context
_No response_
Oh well! Thanks for the response though