Search code examples
pythonpandasspss

Installing pandas for use in SPSS


I have SPSS 28.0.1.1 installed on Mac (monterey 12.2.1). I want to install pandas so I can write python programs using pandas in my spss syntax files. The version of python that comes with SPSS does not have pandas installed. I installed python (3.9) separately and pip installed pandas, but when I tried to set the file location in SPSS to the new python folder, it said it did not find python in the folder.

Since I was not able to connect SPSS to my own version of python, I'd like to try installing pandas in the version of python that comes with SPSS. Does anyone know how to do this with the version of python that comes installed with SPSS?


Solution

  • You indicate you have IBM SPSS Statistics 28.0.1.1 installed and would like to add pandas to the Python3 version that ships with IBM SPSS Statistics.

    Adding libraries to Python in Statistics is documented here: https://www.ibm.com/docs/en/spss-statistics/28.0.0?topic=python-running-code

    See the section "Python 3 3rd party packages"

    Accordingly, to install pandas would be: statisticspython3 -m pip install pandas