Importing Python packages

Some Python libraries are installed with the Extender install. You can then import them in an Extender script.

If you want to use a Python library that is not installed with the Extender install, you can add the following line #@ pip(libraryname) to the script that requires the library.

How does it work?

Behind the scenes, the first time a user runs a script, if the library isn't installed on the machine, Extender downloads the scripts from the database as they are cached for performance reasons. If a script includes @pip, Extender also downloads the required Python packages in the user's temp directory, %LOCALAPPDATA%\COMPANY\{orgid}\scripts\python388\site-packages folder. (or python folder if you use the Python 3.4 version).

To do this, Extender runs @pip and python.exe, which displays the cmd prompt pop-up the first time a user runs the screen. This should only happen once for each network user.

If you delete the files in that folder, they will be downloaded again next time the script runs.

Tip: This feature applies to all scripts, including screen scripts.

Example:

If you need to use the requests library, add a comment line #@ pip(libraryname)

Copy

Install library

#@ pip(requests)
Note:

Some packages are not compatible with Extender, for example numpy and pandas won't work in Extender scripts.

The issue is that numpy does not work with sub-interpreters correctly (see https://lists.archive.carbon60.com/python/dev/1406603). There is nothing Extender can do about that .