Adding Kernels to Your Module

The best way to add support to your module is to first ensure you create a proper package. This will force your users to install all the dependencies you set. In your requirements.txt, simply add the following line:

vskernels>=1.0.4

You can then easily import vs-kernels as you would normally without having to worry whether your users have vs-kernels installed.

In case you don’t have a package or don’t want to create one, the easiest way to is to either import it and catch it in a try/except, or to have a list of required dependencies with links in your README.

An example of catching an import exception:

try:
    from vskernels import Kernel, get_kernel
except ModuleNotFoundError:
    raise ModuleNotFoundError("Could not import vs-kernels! Please download here: "
                              "https://github.com/Irrational-Encoding-Wizardry/vs-kernels")

This will prompt the user to install vs-kernels if they don’t have it already.