SPSS Statistics

 View Only

 Python&SPSS: SpssClient.StartClient() always starts a new invisible instance (since SPSS29)

Joe Finger's profile image
Joe Finger posted Wed October 08, 2025 03:00 AM

Dear community,

For years, we have been using a script that transfers SPSS syntax from Notepad++ to a running SPSS instance using Python. This worked perfectly up to and including version 28.

At this point, we would like to express our sincere thanks to Remix4Dev (--> https://github.com/Remix4Dev/npp-spss)

Basically, a Python file is created and transferred to “statisticspython3.bat”.

Here is an example of such a Python file:

#!/usr/bin/env python
# -*- coding: windows-1252 -*- 
import SpssClient 
SpssClient.StartClient() 
SpssClient.RunSyntax(r“”"
*Running spss code.
get file “D:\test.sav”.“”")
SpssClient.StopClient

This no longer works since SPSS29. Even if a running SPSS instance exists, each “SpssClient.StartClient()” command starts a new, invisible instance.

The Reference Guide states that the "StartClient Method
Establishes a connection to the IBM SPSS Statistics client...If the script is run from an external Python process (such as a Python IDE or the Python interpreter),
an attempt is made to connect to an existing IBM SPSS Statistics client."

It seems that this is no longer the case in SPSS29, as the running SPSS instance is no longer accessed.

Do you have any ideas or solutions for this, and is anyone else aware of this problem?

We are really desperate.

Best regards,
Joe

Art Jack's profile image
Art Jack

This would be great to know.