"ImportError No module named site"

Last edited on

Symptoms

The following error message occurs when executing a test script:

R: ImportError: No module named site

Possible causes

Squish source build without Python

This typically occurs with Squish source builds that have Python configured.

Solution:

Either set the environment variable PYTHONHOME to the path of the Python libraries, or add an entry similar to this:

Scripting/PythonHome = “C:\Python26”

in the file SQUISHDIR/etc/paths.ini. Of course, you must put the correct path for your Python installation there. (Note that Squish only supports Python versions 2.4-2.7.)

This problem can also occur if the PYTHONHOME variable points to a different Python installation than the one used by Squish.

Solution:

Unset the PYTHONHOME environment variable before starting the Squish IDE (or the squishserver).