SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Python integration statisticspython3.bat /sh

    Posted Sat September 11, 2021 07:51 AM

    Hi,

    When running the statisticspython.bat from the command line, I can't use the SpssClient.StartClient() function. Although the errors are a bit different on osx, the result is the same. It's basically the simplest command to control the client and I can't make it work, so any help would be welcome!

    regards, Ed

    Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32

    Type "help", "copyright", "credits" or "license" for more information.

    >>> import SpssClient

    >>> SpssClient.StartClient()

    Traceback (most recent call last):

    File "<stdin>", line 1, in <module>

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\Python3\Lib\site-packages\SpssClient\__init__.py", line 162, in StartClient

    return _SpssClient.StartClient()

    File "C:\PROGRA~1\IBM\SPSS\STATIS~1\27\Python3\Lib\site-packages\SpssClient\__init__.py", line 175, in __raiseJCAdaptorException

    raise JCAdaptorException(eCode, eMsg, eCause)

    SpssClient.JCAdaptorException: (0, 'Port Handshake with JavaClient failed.', '')

    >>>






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Python integration statisticspython3.bat /sh

    Posted Sat September 11, 2021 01:09 PM

    Can you import the spss module and run, say, a simple SHOW ALL command?

    Check the SPSS_HOME environment variable:

    os.environ["SPSS_HOME"]

    within the Python session.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Python integration statisticspython3.bat /sh

    Posted Mon September 13, 2021 09:45 AM

    Hi Jon,

    Reinstalled the software, cleared the win registry and now it works as expected, later this week I try on OSX. Goal is btw to use electron.js as a GUI to replace a .net app that use the spsswin, I think this will work. thanks, Ed






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Python integration statisticspython3.bat /sh

    Posted Mon September 13, 2021 12:43 PM

    Sounds interesting. I hope you can share your experiences as this develops.






    #SPSSStatistics
    #Support
    #SupportMigration