# What Python standard library functions are actually supported?

**URL:** <https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010>\
**Category:** Ignition\
**Created:** [July 23, 2020, 6:04pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010 "2020-07-23T18:04:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [July 23, 2020, 6:04pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/1 "2020-07-23T18:04:13Z")

</div>

I'm playing around with Python and trying to do some stupid things.

From the V8 documentation [Libraries](https://docs.inductiveautomation.com/display/DOC80/Libraries) page, it says:

> Python has an extensive standard library that provides a host of new functionality to the scripting language. The python documentation goes over all of the libraries in its standard library as well as how to use them here: [The Python Standard Library — Python 2.7.18 documentation](https://docs.python.org/2/library/index.html)

OK, so far so good, so I create a simple Gateway startup script:

```auto
import sys
print "hello startup project:" , sys.version

```

Which generates a nice line in the wrapper log file:

`hello startup project: 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43)`

So now I try something slightly more adventurous:

```auto
import sys
import multiprocessing
print "hello startup project:" , sys.version

```

But this causes the startup script to crash and burn with an error message of:

`ImportError: No module named multiprocessing`

The Ignition docs pointed me to the Python 2.7 docs for the standard library functions. The Python docs tell me that multiprocessing is a valid library and was introduced in version 2.6. But the Gateway startup script rejects the import statement. Thus it seems that not all of the Python standard libraries are available to the (Gateway startup?) scripts. So is there any documentation that actually describes what is and is not available?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2020, 6:16pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/2 "2020-07-23T18:16:12Z")

</div>

We don’t have a definitive list, but the [Jython project](https://www.jython.org) might.

The multiprocessing module might have been a bit of bad luck. There’s an issue for it here in the Jython tracker: [https://bugs.jython.org/issue2287](https://bugs.jython.org/issue2287)

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [July 23, 2020, 6:59pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/3 "2020-07-23T18:59:05Z")

</div>

LOL so by a random chance I picked probably the one thing that didn’t work!

After reading various links it seems that the multiprocessing library will not be supported (but now at least I have learnt to google for the Jython version of things).

I also just saw [Gateway Script to monitor directory for new files](http://forum.inductiveautomation.com/t/gateway-script-to-monitor-directory-for-new-files/16124/22) which has examples that seem to be using Java based concurrency, so I just need to change my approach

---

<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:** [July 23, 2020, 7:14pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/4 "2020-07-23T19:14:32Z")

</div>

You can also drill down into your gateway install folder to see what is in the `user-lib/pylib` directory…

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [July 24, 2020, 4:58pm UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/5 "2020-07-24T16:58:12Z")

</div>

Thanks for that tip

---

<div class="post-metadata">

**Author:** ![Kevin.McClusky](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kevin.McClusky](https://forum.inductiveautomation.com/u/Kevin.McClusky)\
**Post date:** [July 29, 2020, 4:09am UTC](https://forum.inductiveautomation.com/t/what-python-standard-library-functions-are-actually-supported/37010/6 "2020-07-29T04:09:09Z")

</div>

Just to add a little to this discussion: The only two Python 2.7 standard libraries that I’ve come across that exist in CPython but not in Jython are multiprocessing and sqlite3.
