"import site failed use -v for traceback"

Last edited on

Symptoms

You get an error message like this:

This application has requested the Runtime to terminate it in an unusual way.

Please contact the application's support team for more information.

'import site' failed; use -v for traceback

starting

Initializing AUT context ...... done.

Failed to set default encoding to UTF-8

squishrunner exited with status 3

Possible causes

Using the wrong Python version

By default, Squish binary packages are built with a specific Python version, in most cases Python 2.4.

This error usually occurs if Squish's Python installation (in SQUISHDIR/python) is replaced by a different version of Python or if Squish is configured to use a different version of Python than the version supplied with the binary package (e.g., to use Python 2.6 when Python 2.4 was supplied).

The easiest solution is to ask support to provide you with a binary package that already includes the Python version you want (e.g., Python 2.5 or Python 2.6).

Also see Changing the Python installation used by Squish binary packages .

This could also be caused by the PYTHONHOME environment variable pointing to a different Python installation than the one used by Squish. Unsetting this environment variable before running the Squish IDE or the squishserver should solve the problem.