Skip to content

Python Packages ​

Last updated

Administration → Python Packages (administrators, with Python scripting on) lists what Python scripts can import and installs more.

Bundled packages ​

These ship with the appliance and import with no install step:

PackageImport asUsed for
numpy, pandasnumpy, pandasArrays, tables, resampling history
SciPy, statsmodelsscipy, statsmodelsStatistics, SPC beyond the built-in charts, regression and trend tests
scikit-learnsklearnAnomaly detection, simple predictive models
openpyxlopenpyxlReading and writing Excel files
pintpintUnit conversion (psi ↔ bar, gpm ↔ L/min)
PyYAML, regex, python-dateutil, pytzyaml, regex, dateutil, pytzConfig files, text parsing, shift and time-zone maths

Their dependencies (six, patsy, joblib, threadpoolctl, packaging, typing-extensions, platformdirs, et-xmlfile, flexcache, flexparser) come with them. The page shows each package's version and which scripts and libraries import it.

Installing a package ​

Accepted: pure-Python wheels (file names ending -py3-none-any.whl) and wheels built for this Pyodide version. Refused, with a reason: native Linux, macOS and Windows wheels, because scripts run Python as WebAssembly; wheels for another Python or Pyodide version; packages that would replace a bundled one.

Upload wheels: click Choose .whl files, select the package and its dependencies together, and click Install. Dependencies are checked on the appliance, offline, against the bundled set, what is installed and the files you selected. A missing one is named straight away, with the command to fetch it.

With no internet on the appliance: on a PC with internet and pip, run the command the page shows, for example:

pip download --only-binary=:all: --platform any --python-version 3.14 --implementation py --dest wheels "humanize==4.9.0"

then upload every file in the wheels folder at once.

Install from PyPI: when the appliance's script network access is on (Settings), type a name, or name==version, and click Install. The appliance downloads the package's pure-Python wheel and any missing pure-Python dependencies from pypi.org, checks every file's SHA-256, and installs them as one set.

Every install is then proven by installing the whole environment, offline, in a throwaway interpreter with micropip. Interpreters started afterwards see the new packages; running scripts finish with what they had.

Removing a package ​

The bin icon removes it after a confirmation that lists the scripts and libraries that import it (they fail with ModuleNotFoundError afterwards). A package another installed package needs can't be removed until that one is.

Good to know ​

  • One shared environment per appliance, versions pinned: every script sees the same versions.
  • Every install, upgrade and removal is in the audit log, with the file's hash.
  • Installed packages are included in backups and come back with a restore.
  • Scripts can't install anything: the package store is read-only to them, and these routes are on the script deny list.
  • Upgrading the appliance can upgrade Pyodide, and with it Python; check uploaded wheels after an upgrade.
MethodPathPurpose
GET/api/python-packagesRuntime, bundled and installed packages, with who imports each (admin)
POST/api/python-packages/uploadInstall uploaded wheels; multipart field wheels (admin)
POST/api/python-packages/pypiInstall from PyPI; body { "spec": "name==version" } (admin)
DELETE/api/python-packages/:nameRemove an installed package (admin)

See also ​

Scada.Ink Help Center