IBM Support

Partial Least Squares (PLS) extension does not run in SPSS Statistics 25, error: Extension command PLS could not be loaded

Troubleshooting


Problem

In release IBM SPSS Statistics 25 the Partial Least Squares Regression PLS extension is installed with the software and available on dialog Analyze – Regression – Partial Least Squares. The latest version that show up on installed Extensions dialog is 1.3.10 and there is no update Launch SPSS 25 with sample file Employee.Data.sav Click Analyze – Regression – Partial Least Squares Use any variables, for example minority as dependent variable and salary and salbegin as independent variable or run below syntax PLS minority MLEVEL=N REFERENCE=LAST WITH salary salbegin /CRITERIA LATENTFACTORS=5 /MODEL salary . Notice the following behavior: PLS will not run. Instead getting below log on Output Viewer, why is this? ('Extension command ', 'PLS', ' could not be loaded. The module or a module that it requires may be missing, or there may be syntax errors in it.')

Resolving The Problem

You have not installed the special requirements to run PLS. Please see the info section on the dialog:
"Special setup is required to run the Partial Least Squares Regression procedure. Click Help and see the Prerequisites section for details".



If you click on Help you will see below text:

Prerequisites

The Partial Least Squares Regression procedure is a Python extension command and requires IBM® SPSS® Statistics - Essentials for Python, which is installed by default with your IBM SPSS Statistics product. It also requires the NumPy and SciPy Python libraries, which are freely available.


Windows and Mac Users

For Windows and Mac, NumPy and SciPy must be installed to a separate version of Python 2.7 from the version that is installed with IBM SPSS Statistics. If you do not have a separate version of Python 2.7, you can download it from http://www.python.org. Then, install NumPy and SciPy for Python version 2.7. The installers are available from http://www.scipy.org/Download.

To enable use of NumPy and SciPy, you must set your Python location to the version of Python 2.7 where you installed NumPy and SciPy. The Python location is set from the File Locations tab in the Options dialog (Edit > Options).

Worked out Example to get PLS to run in SPSS Statistics version 25 on a Windows 64 bit computer.

**********

PLEASE NOTE: IBM cannot guarantee that any of the links mentioned here - that refers to another vendors page - will still exist after some time. If a link to a certain Python or NumPy or Scipy version does no longer show older versions of the package, you can search on internet for other locations of those Versions. For example if you search for NumPy version 1.13.1 on internet numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl you may find other locations that list this version like on https://www.silx.org/pub/wheelhouse/


1. Install Python 2.7.13
First, make sure you have external Python 2.7 installed. Minimum requirement is Python 2.7.9. The below example use Python 2.7.13 release
Windows 64 bit: The 64-bit Python download link is
https://www.python.org/ftp/python/2.7.13/python-2.7.13.amd64.msi

Save the file python-2.7.13.amd64.msi to your desktop
---
NOTE for Windows 32 bit: If you have a Windows 32 bit computer use below link and download Python 2.13.msi
https://www.python.org/downloads/
-----
DO NOT use the 32 bit Python on a Windows 64 bit system. Use 2.7.13.amd64.msi instead
-----
Install 2.7.13.amd64.msi for 64 bit Windows. Click on the downloaded file python-2.7.13.amd64.msi and start the installation


Recommended is to install to default directory C:\Python27



2. Verify the content of C:\Python27\Scripts folder
Once the installation of Python 2.7 is finished got o path C:\Python27\Scripts and verify if you see pip.exe, as we will need this later.



3. Download Numpy and Scipy from

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Scroll down the page to find the required packages:
3.a)


numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl

3.b)


scipy-0.19.1-cp27-cp27m-win_amd64.whl

4. Use the pip command in Python 2.7 to install the Numpy and Scipy

For Numpy the command is:
pip install C:\numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl
For Scipy the command is:
pip install C:\scipy-0.19.1-cp27-cp27m-win_amd64.whl

To do so open an Administrator command prompt on your windows 64 bit machine and change directory to C:\Python27\Scripts. Run above commands. If it was successful you should see text like on below example

**************Example***************************


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\IBM_ADMIN>cd..

C:\Users>cd..

C:\>cd python27\scripts

C:\Python27\Scripts>pip install C:\numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl
Processing c:\numpy-1.13.1+mkl-cp27-cp27m-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy-1.13.1+mkl

C:\Python27\Scripts>pip install C:\scipy-0.19.1-cp27-cp27m-win_amd64.whl
Processing c:\scipy-0.19.1-cp27-cp27m-win_amd64.whl
Requirement already satisfied: numpy>=1.8.2 in c:\python27\lib\site-packages (fr
om scipy==0.19.1)
Installing collected packages: scipy
Successfully installed scipy-0.19.1
****************

5. Set External Python 2.7.13 to be used in Statistics 25
Open Statistics 25 release and click on Edit – Options – file locations tab. Edit the section: Python 2.7 Location and browse to your external Python 2.7 installtion directory.


6. Run your PLS command.

As a test use the below one for sample file Employee Data.sav



PLS minority MLEVEL=N REFERENCE=LAST WITH salary salbegin
/CRITERIA LATENTFACTORS=5.

PLS will then run successfully

[{"Product":{"code":"SSLVMB","label":"SPSS Statistics"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Statistics Programmability Extension","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"},{"code":"PF022","label":"OS X"}],"Version":"25.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
23 October 2020

UID

swg22007874