How To Fix Python Setup Issues
Message Manager uses Jep (Java Embedded Python) for the execution of Python scripts. When the scripting engine is initialized, it will try to load the Jep library. If this fails, the scripting engine will not be available. Alternatively, you can use Apache Jexl (Java Expression Language) instead of Jep.
Example
When using Python you may encounter the following error:
ERROR: Python Executor could not be initialized: Could not find Jep library, null
ERROR: Failed to run script: Failed to run script:Error executing Python script. Ensure Python is on PATH and you installed Jep: pip install jep --no-cache-dir
Solution
- Ensure you have Python installed and on PATH. Yo can check this by opening a command prompt and running the following command: python --version
- Ensure you have the Jep library installed. You can install it by running the following command: pip install jep --no-cache-dir
- If you are using a python virtual environment then ensure you have configure this via a setenv script in the Message Manager bin directory (i.e. /Users/stefan/Library/Application Support/conapi/Message Manager/bin).
MacOS Example:
/Users/stefan/Library/Application Support/conapi/Message Manager/bin/setenv.sh
# working with virtual Python environments
# Homebrew: Python
#export PATH="/opt/homebrew/opt/python/libexec/bin:$PATH"
export PATH="$(brew --prefix)/opt/python@3/libexec/bin:$PATH"
# Created by `pipx` on 2024-11-19 07:43:54
export PATH="$PATH:/Users/stefan/.local/bin"
source ~/venvs/default/bin/activate