Requires the following resources:
- An internet connection to download and install Simian GUI from our PyPi server (or an offline alternative).
- License file valid for your machine.
Create and activate a Python environment.
Note: If you want to run locally, use Python 3.8 or 3.9. Python 3.10 and above are currently not supported by PyWebview.
Install the packages using
pip install --extra-index-url https://pypiserver.monkeyproofsolutions.nl/simple/ simian-gui simian-local simian-examples
Note that for installation on a deployment server the
simian-examplespackages are not required.
pywebviewas a dependency. To verify it is installed correctly on your system, run the following python commands. A window, displaying the PyWebview web page, should open.
import webview webview.create_window('Hello world', 'https://pywebview.flowrl.com/') webview.start()
If you want to use Redis cache (for deployed mode) it can be specified as optional dependency of the
pip install simian-gui[redis]
If you need to troubleshoot license failures, you may also want to install the
pip install simian-gui[pyarmor]
Make your license file available by specifying its location in the
PYARMOR_LICENSEenvironment variable, as documented in the license section
Testing your setup
You can test your environment setup by running the following commands in your Python environment:
import simian.gui form = simian.gui.Form()
If you get a
Form object, your environment is setup correctly. If
pywebview is installed correctly in your Python environment, you should be able to start the BallThrower example locally by running the following commands:
import simian.local simian.local.Uiformio("simian.examples.ballthrower", window_title="Ball Thrower")
If you get an error, you can check this against these error messages and solutions:
ModuleNotFoundError: No module named 'simian'Simian GUI was not found on the Python path. Ensure that the
simian-localpackages are installed.
ModuleNotFoundError: No module named 'simian.examples.ballthrower'The
simian-examplespackage was not found on the Python path. Ensure that the
simian-examplespackage is installed.
ModuleNotFoundError: No module named xxxEnsure that all dependencies are installed in your Python environment.
License errors and potential solutions are described in the Invalid license message section.
Simian GUI contents
A full Simian GUI installation in your Python environment installs the following folders and files in the
ballthrower.pyModule implementing the BallThrower application. It contains the
gui_eventfunctions that define the user interface of the application.
ballthrower_model.pyModule with a class that implements the ball throwing model.
pytransform: Utility for license validation.
guiFolder containing Simian GUI code.
config.jsonFile containing the version number of the front-end.
entrypoint.pyUtility for handling callbacks.
htmlFolder containing the front-end build for PyWebview.
eventh_handler.pyUtility for communication with tht PyWebview window.
local.pyThe Simian Local module.
local.pyiPython stub file containing type hints for the