Troubleshooting

Common problems when running a Python manager, and how to resolve them.

Where to Look

Almost every problem is reported in the log:

  • Records of level INFO and higher from your script, and all messages of the process monitor (PMON), are written to <project>/log/PVSS_II.log.
  • Records of level DEBUG go to the manager-specific log file.

The LogViewer displays the content of these files. Start there before changing anything.

The Manager Does Not Start

Python manager requires a .py script in options

The options field of the manager contains no script name. PMON identifies the script by the .py suffix.

Add the script name to the options field, for example hello_world.py -num 50.

<script> not found in python/ search paths

The script name is present but the file cannot be located. PMON looks for it in the python/ directory of the project, then in its subprojects, then in the installation.

Check that the file exists in <project>/python/ and that the name in the options field matches exactly, including uppercase and lowercase.

The manager stops with an error about the interpreter

The python executable cannot be found. WinCC OA searches the bin/ directories of the project, its subprojects and the installation, and finally the system PATH.

Install CPython in the released version for your operating system, or place the executable — or a link to it — in <project>/bin/. See Installation.

Import Errors

ModuleNotFoundError: No module named 'etm.wccoa'

The runtime component PythonEnv is not installed, so the packages are missing from <WINCCOA_ROOT>/python/libs/.

Install the component and start the manager again. See Installation.

The native extension fails to load

The error appears as ModuleNotFoundError: No module named '_etm_wccoa_manager_scripting', on Windows also as ImportError: DLL load failed, and on Linux as an ImportError about an undefined symbol.

Two causes are likely:

  • The CPython version does not match the extension that was shipped for your platform. Install the released version described in Installation.
  • The extension cannot find the WinCC OA libraries next to it. This happens when the script is started outside of PMON without the environment prepared; see Development Environment.

ImportError: _etm_wccoa_manager_scripting requires CPython X.Y or newer

The running CPython is older than the version the extension was built with. The extension refuses to load, because it is not compatible with older CPython versions.

Install the released version described in Installation.

The Script Exits Immediately

The manager starts, writes its first log records and terminates without an error.

A script ends when the last statement of the with block has been executed. If the script only registers callbacks and has nothing else to do, it must keep the manager running instead of falling off the end of the block. See Manager.