SPSS Statistics

SPSS Statistics

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


#Analytics
#SPSSStatistics
#Analyticstools
 View Only
  • 1.  Getting errors while running PLS

    Posted 05/10/21 05:02 AM

    I installed PLS extension bundle for my SPSS26. I got Python27. Installed numpy and scipy for my python version and set the python2 path on SPSS to the path of python2 having numpy and scipy in my C directory. Still on running PLS, I am getting the following errors:

    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.

    Kindly help me.

    Thanks,

    Shilpi






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Getting errors while running PLS

    Posted 05/10/21 12:54 PM

    If you downloaded PLS recently, it would be a Python 3 version, so you would need to use Python 3 versions of numpy and scipy.

    Try running this code in a syntax window to get a more precise error message.

    begin program python3.

    import PLS

    end program.

    You might also want to install a version of PLS from here

    https://1drv.ms/u/s!AoWcE61g_FAdisIdnggsYvcuNuCMDQ?e=3fsg11

    as the initial conversion to Python 3 had some problems. I don't know whether the currently posted version has the fixes.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Getting errors while running PLS

    Posted 05/10/21 01:38 PM

    Thanks for your reply. Yes it appears that the python 2 versions of scipy are not being read by SPSS. Hers's what I got:

    begin program python3.

    import PLS

    end program.

    Traceback (most recent call last):

    File "C:\\ProgramData\\IBM\\SPSS\\Statistics\\26\\extensions\PLS.py", line 81, in <module>

    from scipy import *

    ImportError: No module named 'scipy'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

    File "<string>", line 2, in <module>

    File "C:\\ProgramData\\IBM\\SPSS\\Statistics\\26\\extensions\PLS.py", line 83, in <module>

    if not e.message.startswith("cannot import name"):

    AttributeError: 'ImportError' object has no attribute 'message'

    EXTENSION /SPECIFICATION COMMAND='C:\ProgramData\IBM\SPSS\Statistics\26\extensions\plscommand.xml'.

    However, my SPSS26 has Python 3.4 associated with it. So does that mean I install a separate Pyhon3.4 version somewhere else and then put it in the path of SPSS?

    Thanks,






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Getting errors while running PLS

    Posted 05/10/21 01:58 PM

    Try installing 3.4 somewhere and then installing numpy and scipy for that version. Then set that external 3.4 as the version for Statistics to use via Edit > Options > Files






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Getting errors while running PLS

    Posted 05/10/21 03:18 PM

    Support Member​  IBM SPSS Statistics 27.0 and now 27.0.1 requires Python 3.8. You should be able to install a separate (external) Python 3.8 from python.org. Then install numpy and scipy via command line:

    >python3.exe -m pip install numpy scipy






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Getting errors while running PLS

    Posted 05/10/21 04:16 PM

    Hi,


    I installed Python3.4. Then when trying to install numpy I am getting the following error:


    C:\Python34\Scripts>pip install C:\Downloads\numpy-1.16.6 mkl-cp34-cp34m-win_amd64.whl

    Traceback (most recent call last):

     File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main

      "__main__", mod_spec)

     File "C:\Python34\lib\runpy.py", line 85, in _run_code

      exec(code, run_globals)

     File "C:\Python34\Scripts\pip.exe\__main__.py", line 5, in <module>

     File "C:\Python34\lib\site-packages\pip\__init__.py", line 1, in <module>

      from typing import List, Optional

    ImportError: No module named 'typing'


    Thanks






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: Getting errors while running PLS

    Posted 05/10/21 04:44 PM

    That makes me wonder whether you actually are running 3.4 materials, because the typing module was new in Python 3.5, but try doing a pip install of typing.






    #SPSSStatistics
    #Support
    #SupportMigration