Weird behaviour with CPython

Weird behaviour

Hello guys, I am facing weird bug while using CPython. When I use the below code, I am getting IronPython output.

#
#! python3

print("Hello from CPython")
import sys
print(sys.version)

Output -

Hello from CPython
2.7.12 (2.7.12.1000) 
[.NETStandard,Version=v2.0 on .NET 8.0.27 (64-bit)]

But when I use the below code, I am getting error.

#! python3

print("Hello from CPython")
import sys
print(sys.version)


Can someone share the explaination :sweat_smile: ?

Can you check the output of ‘pyrevit env’ command line?

@Jean-Marc Output from pyrevit env -

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Branch: "master" | Version: "6.4.0.26100+0515" | Path: "C:\Users\ACER\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "2027" | Engine: DEFAULT (2712) | Path: "C:\Users\ACER\AppData\Roaming\pyRevit-Master"
master | Product: "2026 First Customer Ship" | Engine: DEFAULT (2712) | Path: "C:\Users\ACER\AppData\Roaming\pyRevit-Master"
master | Product: "2025 First Customer Ship" | Engine: DEFAULT (2712) | Path: "C:\Users\ACER\AppData\Roaming\pyRevit-Master"
master | Product: "2024.3.4" | Engine: DEFAULT (2712) | Path: "C:\Users\ACER\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
guRoo | Type: Unknown | Repo: "https://github.com/aussieBIMguru/guRoo.git" | Installed: "D:\Software files\Revit\pyRevit plugins\guRoo.extension"
pyChai_dev | Type: UIExtension | Repo: "" | Installed: "D:\Code Development\Projects\BIM\Revit\pyChai\extensions\pyChai_dev.extension"
==> Default Extension Search Path
C:\Users\ACER\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
D:\Code Development\Projects\BIM\Revit\pyChai\extensions
D:\Software files\Revit\pyRevit plugins
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
2027 | Version: 27.0.4.412 | Build: 20260228_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2027\"
2026 First Customer Ship | 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:\Software installed\Autodesk\Revit 2025\"
2024.3.4 | Version: 24.3.40.26 | Build: 20250918_1515(x64) | Language: 1033 | Path: "C:\Software installed\Autodesk\Revit 2024\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages