Skip to main content

The requirements file

This file lists the Python dependencies of your project. It should start with # viktor==... (note the hashtag), specifying the VIKTOR SDK version. Any other optional library dependencies can be added underneath the usual way (without hashtag). For example:

# viktor==13.3.0
drawSVG==1.3.1

Pinning version number and version clashes

Both the VIKTOR SDK and drawSVG package have an explicit version number defined (pinned version numbers). This is done to ensure that your app always uses the same version. If the package maintainers release a new version overnight, this does not break your app when re-installing. By pinning the versions, you decide when to upgrade to a newer version and this enables reading the CHANGELOG which might contain necessary actions for upgrading.

It is possible that you are using a package which is also used by the VIKTOR SDK. The SDK defines a range of allowed versions. If the app specifies a version outside this range, an error will be logged:

ERROR: viktor X.X.X has requirement numpy>=1.15.3, but you'll have numpy 1.15.0 which is incompatible.

This might also happen when you don't have a pinned version number and the latest version has not yet been added to the SDK range.

note

External packages that are internally used in the SDK are available in your app (e.g. munch), even when you don't add them to your app's requirements.txt. Nevertheless, you are highly encouraged to explicitly define them in your app requirements, as deletion of dependencies within the SDK will be done without prior notice and therefore may break your app!

caution

Beware to look at the license of the package before using it in your app. Some licenses do not allow for commercial use, or might necessitate open-sourcing your implementation.