Pollination Revit plugin conflict with pyRevit

Hey there,

After installing the Pollination Revit plugin, I got below startup error for pyRevit. Perhaps there is a module conflict? After I uninstalled pollination, it dissapeared again.

Cheers,
Guus

IronPython Traceback:
Traceback (most recent call last):
 File "C:\ProgramData\pyRevit\base\extensions\pyRevitCore.extension\startup.py", line 3, in <module>
 File "C:\ProgramData\pyRevit\base\pyrevitlib\pyrevit\__init__.py", line 93, in <module>
 File "C:\ProgramData\pyRevit\base\pyrevitlib\pyrevit\framework.py", line 76, in <module>
ImportError: Cannot import name ManagementObjectSearcher

Script Executor Traceback:
IronPython.Runtime.Exceptions.ImportException: Cannot import name ManagementObjectSearcher
 at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
 at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path)
 at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str)
 at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader)
 at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path)
 at IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, PythonModule module, String[] parts, Int32 current, List path)
 at IronPython.Runtime.Importer.ImportModuleFrom(CodeContext context, Object from, String[] parts, Int32 current)
 at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level)
 at IronPython.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
 at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
 at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path)
 at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str)
 at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader)
 at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path)
 at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext context, String name)
 at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level)
 at IronPython.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute6[T0,T1,T2,T3,T4,T5,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
 at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

hi @GooseG
try disabling these in the \pyRevit-Master\extensions\pyRevitCore.extension\startup.py

"""pyRevit core startup script"""
#pylint: disable=import-error,unused-import,invalid-name
#from pyrevit.coreutils.logger import get_logger # disable this line
from pyrevit.userconfig import user_config


# mlogger = get_logger(__name__) # disable this line too


# decide to load the core api
if user_config.load_core_api:
    import pyrevitcore_api
    # mlogger.info("pyRevit Core Routes API is activated")

to see if it goes further

I uninstalled a previous version of the pollination plugin for revit and reinstalled it, it worked with the latest pyrevit version.
I noticed the location of your libs are different?
you may want to try with a regular install

What libs do you mean?

you mean with the pyrevit .exe installer?
We have a custom CLI installer for our organization and I have limited access to it.

I will try this!

This path :point_up:

If possible, I would try to remove pyRevit (your custom install) and just install the regular one to see if it interacts badly as well

I’m afraid I don’t have admin rights to do that.

Just tested this but same error comes up again.

Version info I am testing with:

  • plugins_release_PollinationRevitInstaller-2.172.0
  • pyRevit 4.8.12.22247+0031 with attached engine IPY2710

pyRevit was working but the reload button wasn’t anymore.
I uninstalled Pollination and everything went back to normal.

Bad interaction with pollination latest, as it seems

Kind of hard to debug then

Yes tell me about it…
I have cross posted the issue on the pollination forums! Maybe the light can be found there :bulb:

1 Like