Solution
Open AutoKey and click: Edit>Preferences>Script Engine> and select a folder where the pyautogui is located (or contained).
For me that was:
home/<my linux username>/anaconda3/lib/python3.7/site-packages
Approach
I initially tried:
import mouse
mouse.wheel(delta=1)
But that requires sudo, and from what I read here it appears the AutoKey does not like the mouse module too much. Running this script from AutoKey gave the error:
ImportError:You must be root to use this library on Linux`
Then I tried your module named pyautogui. That gave the error that it could not find the module pyautogui even though it was installed.
I first installed pyautogui on the Anaconda base environment with pip install pyautogui. Though it could not find it, so I deactivated anaconda with conda deactivate and installed again on the linux python version with pip install pyautogui. AutoKey could (still) not find it after restarting AutoKey. But after linking to the package of pyautogui it could find it.
Room for Improvement
I think this solution can be improved by automating it, as it is a basic functionality that one might like in every (new instance) of a Ubuntu OS. Therefore, the AutoKey could be installed automatically, along with the pyautogui. If the location is determined where autokey stores this preference, it can be set automatically.
Also, I don't have it working yet in jupyter notebook.