[UserPyModules] Different results from executing code in external python environment vs ecu.test

Issue

A Python script is stored in User python library directory stored in ecu.test.

grafik-20240112-131821.png

 

Executing this script in ecu.test yields different results than executing the same script in a local python
installation (e.g. via cmd).

The exact differences depend on the specifics of the python script.

It is possible that the script is not running at all but throwing error messages instead.

Solution

ecu.test brings its own Python environment including 3rd party libraries and all Python code
(including UserPyModules) will run in said environment.

Follow these guidelines when developing Python scripts for ecu.test:

  1. The script is developed for the Python version that is used by ecu.test.
    See: ..\ecu.test <version>\LICENSE-NOTES\Python\PSF LICENSE AGREEMENT FOR PYTHON.txt

  2. The script ideally only uses 3rd party libraries that come with ecu.test.
    See: ..\ecu.test <version>\LICENSE-NOTES\Python\Included3rdPartyPythonLibs.html

  3. In case the script does require libraries beyond 2., make sure to add them to ecu.test first
    and that they are compatible with the used Python version (see 1.)
    Have a look at our ecu.test help (Docs / Extensions / External Python libraries) as well.

We do under no circumstances support adding libraries (see 3.), if they are already part of the default library package (see 2.)!