# runScript and 3rd party python lib

**URL:** <https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583>\
**Category:** Ignition\
**Created:** [October 5, 2017, 1:23pm UTC](https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583 "2017-10-05T13:23:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steiger](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@steiger](https://forum.inductiveautomation.com/u/steiger)\
**Post date:** [October 5, 2017, 1:23pm UTC](https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583/1 "2017-10-05T13:23:21Z")

</div>

I want to make use of a method from a 3rd party python lib (/var/lib/ignition/user-lib/pylib) inside runScript expression.

According to the online help for the runScript expression the scope has either to be “shared.” or “project.”. What is to use in connection with 3rd party libs. Is it possible?

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [October 5, 2017, 1:34pm UTC](https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583/2 "2017-10-05T13:34:53Z")

</div>

What if you create a function in the project scripting scope that calls the function you want to use in the 3rd party python lib and gives you the return value?

---

<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 5, 2017, 2:04pm UTC](https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583/3 "2017-10-05T14:04:02Z")

</div>

Or simply use `from someModule import someFunction` to pull the target function into a shared or project script’s scope. Then you can use `project.scriptModule.someFunction` in runScript().

---

<div class="post-metadata">

**Author:** ![steiger](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@steiger](https://forum.inductiveautomation.com/u/steiger)\
**Post date:** [October 5, 2017, 2:36pm UTC](https://forum.inductiveautomation.com/t/runscript-and-3rd-party-python-lib/15583/4 "2017-10-05T14:36:13Z")

</div>

Thank for your suggestions. I thought it would be possible to use a function from a third party lib without the workaround to pull it into a project or shared scoped function.

Later a found an example in the online manual for the runScript expression:

```auto
Here is an example, where the root container has a custom function called "calculateAggregates(dataset)":
runScript("self.calculateAggregates", 0, {Root Container.MyDataSet})

```

This approach seems also to be a good solution.
