# Dynamic import script module, importlib can be used?

**URL:** <https://forum.inductiveautomation.com/t/dynamic-import-script-module-importlib-can-be-used/97330>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 16, 2024, 4:40pm UTC](https://forum.inductiveautomation.com/t/dynamic-import-script-module-importlib-can-be-used/97330 "2024-10-16T16:40:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 16, 2024, 6:09pm UTC](https://forum.inductiveautomation.com/t/dynamic-import-script-module-importlib-can-be-used/97330/3 "2024-10-16T18:09:54Z")

</div>

> [@mazeyrat](#):
>
> is there any problem to use **importlib ?**

Not sure. I have my doubts.

You certainly should **never** import any Ignition project library script. **Never**. (Ignition uses its own "import" machinery.)

> [@mazeyrat](#):
>
> Script function from project **Global** can call function declared in Project **Final**

Sure, as long as the ultimate origin of the call stack is in project Final.

Such a function in Global would depend on the ultimate caller's context to have an implementation of the named function. Different leaf projects could have different implementations.

Edit: This long-standing script library bug in Ignition's "auto import" behavior is relevant here:

> [@Project Library Script Initialization Races](https://forum.inductiveautomation.com/t/project-library-script-initialization-races/98636):
>
> Are you annoyed by pseudo-random breakage in Ignition project library scripting? Odd top-level constants being garbled, or operations in the top level that have side effects running twice? Or more? Not happening much, but always around project edits, and sometimes even on gateway restart? Yeah, me too. frowning_face Poking around under the hood back in the spring, for a module development task, I ran across some problematic IA bytecode and pinged some people. But it went nowhere, as I co…

---

_[View the full topic](https://forum.inductiveautomation.com/t/dynamic-import-script-module-importlib-can-be-used/97330)._
