pyrevitlabs / pyRevit

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

[Bug]: pyRevit 5.0.0.24309 does not properly attach to Revit 2025 (ImportError: No module named NetworkInformation) #2459

Closed MtMcKinley closed 1 week ago

MtMcKinley commented 1 week ago

✈ Pre-Flight checks

🐞 Describe the bug

After installing pyRevit 5.0.0.24309 and opening Revit 2025, the following error message pops up: p3 And after closing the error message, pyRevit does not appear in Revit 2025. Revit continues to work, but the pyRevit banner does not appear.

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
File "C:\Program Files\pyRevit-Master\bin\netcore\engines\pyRevitLoader.py", line 30, in <module>
File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 30, in <module> File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\versionmgr\updater.py", line 14, in <module> ImportError: No module named NetworkInformation

Script Executor Traceback:
IronPython.Runtime.Exceptions.ImportException: No module named NetworkInformation
at IronPython.Runtime.Importer.ImportModuleFrom(CodeContext context, Object from, String[] parts, Int32 current) in 
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\Iron Python\Runtime\Importer.cs:line 157
at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\Importer.cs:line 280
at IronPython.Modules.Builtin.__import_(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) in 73
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Modules\Builtin.cs:line
at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\Importer.cs:line 53
at IronPython.Runtime.Operations.Python Ops.ImportWithNames (CodeContext context, String fullName, String[] names, Int32 level) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\Operations\PythonOps.cs:line 1878
at Microsoft.Scripting.Interpreter.FuncCallInstruction 5.Run(Interpreted Frame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs:line 750
at Microsoft.Scripting.Interpreter.Interpreter.Run(Interpreted Frame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
at Microsoft.Scripting.Interpreter.LightLambda.Run1 [TO,TRet] (TO arg0) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 55
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 64
at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 44
at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\PythonContext.cs:line 1145
at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, Source Unit sourceCode, ModuleOptions options, ScriptCode& scriptCode) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Runtime\PythonContext.cs:line 1174
at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Runtime\PythonContext.cs:line
1164
at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\Iron Python\Runtime\Importer.cs:line 966
at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Runtime\Importer.cs:line 925 at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Runtime\Importer.cs:line 881
at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func'5 defaultLoader) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Runtime\Importer.cs:line 842
at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\Importer.cs:line 816
at IronPython.Runtime.Importer.ImportNested Module(CodeContext context, Python Module module, String[] parts, Int32 current, List path) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Runtime\Importer.cs:line 661
at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Runtime\Importer.cs:line 111 at IronPython.Runtime.Operations.PythonOps.ImportFrom(CodeContext context, Object module, String name) in
D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\Iron Python\Runtime\Operations\PythonOps.cs:line 1890
at Microsoft.Scripting.Interpreter.FuncCallInstruction 4.Run(Interpreted Frame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs:line 726
at Microsoft.Scripting.Interpreter.Interpreter.Run(Interpreted Frame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
at Microsoft.Scripting.Interpreter.LightLambda.Run2[TO,T1,TRet] (TO arg0, T1 arg1) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 86
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\Iron Python\Compiler\PythonScriptCode.cs:line 65
at IronPython.Compiler.PythonScriptCode.Run(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\PythonScriptCode.cs:line 56
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 85
at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.Iron Python2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 44
at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) in /_/Src/Microsoft.Scripting/SourceUnit.cs:line 218
at Microsoft.Scripting.SourceUnit.Execute(Scope scope) in /_/Src/Microsoft.Scripting/SourceUnit.cs:line 206
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) in /_/Src/Microsoft.Scripting/Hosting/ScriptSource.cs:line 109
at PyRevitLoader.ScriptExecutor.ExecuteScript(String sourcePath, IEnumerable`1 sysPaths, String logFilePath, IDictionary`2 variables)

♻️ To Reproduce

Install Revit 2025 Install pyRevit 5.0.0.24309 Open Revit 2025 Error Message Appears Close Error Message Revit 2025 does not contain pyRevit 5.0.0.24309 😢

⏲️ Expected behavior

Install Revit 2025 Install pyRevit 5.0.0.24309 Open Revit 2025 pyRevit is installed and function within Revit 2025

🖥️ 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.0.24309+2043-wip" | Path: "C:\Program Files\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2025" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "Autodesk Revit 2024" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2023.1.1" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2022.1.2" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2021.1.6" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\User\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/pyrevitlabs/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\"
Autodesk Revit 2024 | Version: 24.3.0.13 | Build: 20240912_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
2023.1.1 | Version: 23.1.10.4 | Build: 20221122_1550(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
2022.1.2 | Version: 22.1.21.13 | Build: 20220123_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
2021.1.6 | Version: 21.1.60.25 | Build: 20220123_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.

Additional context

SentinalOne is installed, but exceptions have been made for both Revit and pyRevit in both the software and %appdata% folders, as per all possible and recommended fixes in the installation troubleshooting guide

jmcouffin commented 1 week ago

Fixed on the 10th by https://github.com/pyrevitlabs/pyRevit/actions/runs/11765997630

Please uninstall pyrevit and install latest wip.

Thanks for taking the time to report.