5

I need to put a certain code developed in Python 3 into a SPSS Modeler node (using the Extension Transform node). This code uses pandas and the default installation of Modeler doesn't include this module.

I tried to make SPSS to point to my own Python installation (which includes pandas module) by modifying the 'options.cfg' file following these instructions:

https://www.ibm.com/support/knowledgecenter/en/SS3RA7_sub/modeler_r_nodes_ddita/clementine/r_pyspark_api.html

However, when I try to import pandas inside SPSS Modeler, it isn't able to load the module. In fact I am not able to load pyspark neither by writing:

import spss.pyspark

Also when I try to see the directory of the python executable:

import sys print sys.executable

SPSS gives back a 'None' value.

How can I get to work pandas in SPSS Modeler? It seems that I am not able to import any module in Modeler. I am a beginner in SPSS so any help would be appreciated.

Pacullamen
  • 165
  • 1
  • 1
  • 7

1 Answers1

4

You can install new packages to your existing SPSS Modeler 18.1 Version by going to your installation path, e.g. "C:\Program Files\IBM\SPSS\Modeler\18.1" and then into the folder python. There you open a windows command shell in admin mode. Now enter

python.exe -m pip install pandas

and it will install the library for SPSS to use.

pandayo
  • 310
  • 2
  • 13
  • 1
    One more thing to add if anybody ever has a similiar problem: The Modeler (18.1/2) uses Python 2.7.x – pandayo Feb 07 '19 at 09:20