Skip to content

[Bug]: 5.0.1 Callable changed in cpython 3.10 - pyutils.py - Line 13 #2633

@aaronrumple

Description

@aaronrumple

✈ 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

pyutils.py Line 13 fails if imported under cpython 3.12.3
from collections import OrderedDict, Callable

Callable was moved in 3.10 to collections.abc

cpython:
from collections import OrderedDict
from collections.abc import Callable

IronPython 3.4:
from collections import OrderedDict, Callable

⌨ Error/Debug Message

CPython Traceback:
cannot import name 'Callable' from 'collections' (C:\Users\Aaron\AppData\Roaming\pyRevit-Master\bin\cengines\CPY3123\python312.zip\collections\__init__.pyc)

pyRevitLabs.PythonNet
File "C:\Users\Aaron\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\coreutils\pyutils.py", line 13, in <module>
 from collections import OrderedDict, Callable #pylint: disable=E0611
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\Aaron\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\extensions\genericcomps.py", line 12, in <module>
 from pyrevit.coreutils import pyutils
 File "C:\Users\Aaron\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\script.py", line 36, in <module>
 from pyrevit.extensions.genericcomps import GenericUICommand
 File "<string>", line 2, in <module>
 at Python.Runtime.PythonException.ThrowLastAsClrException()
 at Python.Runtime.PythonException.ThrowIfIsNull(NewReference& ob)
 at Python.Runtime.PyModule.Exec(String code, BorrowedReference _globals, BorrowedReference _locals)
 at Python.Runtime.PyModule.Exec(String code, PyDict locals)
 at PyRevitLabs.PyRevit.Runtime.CPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

#! python3
from pyrevit import script
output = script.get_output()
output.print_md('# My Title')
output.print_md('Bold message')

⏲️ 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 | Branch: "master" | Version: "5.0.1.25051+1239" | Path: "C:\Users\Aaron\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "2025 First Customer Ship" | Engine: IPY342 (342) | Path: "C:\Users\Aaron\AppData\Roaming\pyRevit-Master"
master | Product: "2024.3.1" | Engine: IPY342 (342) | Path: "C:\Users\Aaron\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
MyExtensions | Type: Unknown | Repo: "" | Installed: "D:\Documents\mySlice of Py\MyExtensions.extension"
==> Default Extension Search Path
C:\Users\Aaron\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
D:\Documents\mySlice of Py
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2026 | Version: 26.0.4.409 | Build: 20250227_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2026\"
2025 First Customer Ship | Version: 25.0.2.419 | Build: 20240307_1300(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
2024.3.1 | Version: 24.3.10.22 | Build: 20241105_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
==> Running Revit Instances
PID: 27896 | 2024.3.1 | Version: 24.3.10.22 | Build: 20241105_1515(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2024"
==> User Environment
Microsoft Windows 10 [Version 10.0.26100]
Executing User: TARDIS\aaronrumple
Active User: TARDIS\aaronrumple
Admin Access: No
%APPDATA%: "C:\Users\Aaron\AppData\Roaming"
Latest Installed .Net Framework: 8.0.14
No .Net Target Packs are installed.
No .Net-Core Target Packs are installed.
pyRevit CLI v5.0.1.25051+1239.a19f9a76cf00d7256cf522f5ec874fea9dd0baa8

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug that stops user from using the tool or a major portion of pyRevit functionality [class]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions