SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  NoSectionError when trying to import spss in Spyder IDE

    Posted Wed August 09, 2023 03:21 PM

    Hello,

    I tried to find information about the problem I met when importing spss module in Spyder IDE to work externally with it, but no luck.

    The following error is raised when trying to import: NoSectionError: No section: 'version'. It seems it comes from the configparser, but I cannot fix it for some reason. Do you happen to know why this happens and how I can eliminate it?

    Thanks.



    ------------------------------
    Bella Bunardzhieva
    ------------------------------


  • 2.  RE: NoSectionError when trying to import spss in Spyder IDE

    Posted Wed August 09, 2023 03:52 PM

    I don't use Spyder myself, but I have heard from users over the years that they have had various problems with it.  Some time ago I tried to get Spyder to work with SPSS, but I never succeeded.  Personally, I use Wing IDE Professional, which is not free.  There is a free basic version of Wing, however.  I think VS CODE and the free version of PyCharm would also work.



    ------------------------------
    Jon Peck
    ------------------------------



  • 3.  RE: NoSectionError when trying to import spss in Spyder IDE

    Posted Thu August 10, 2023 06:45 AM
    Edited by Bella Bunardzhieva Thu August 10, 2023 07:17 AM

    Hi Jon,

    Thanks for answering. I managed to load the module in Spyder, anyway I still encounter an issue in function StartSPSS with "tempfileS" created in temp folder, then removed. Later the function is trying to open it for reading, but it's no longer there. It seems to me that the compiled PyInvokeSPSS is not working as it should, and I don't actually know what it does inside. I suppose the file should be created again, but it's not. If you know a resolution, I would appreciate it. 

    The reason to use Spyder is because it's corporate decision and I cannot use any other IDE. Also the python packages in SPSS directory are read-only, so I can barely test anything there. 

    Thanks for any input.



    ------------------------------
    Bella Bunardzhieva
    ------------------------------



  • 4.  RE: NoSectionError when trying to import spss in Spyder IDE

    Posted Thu August 10, 2023 09:15 AM
    It's too bad that you are forced to use Spyder, but I don't have any more information on it.

    If  you are using SPSS 29 or, I think, V28, supplemental packages are installed in a separate, writable location as SPSS uses a virtual environment for Python and R.  You should not need to modify anything in the Python installation itself.  For me in V29, that location is
    c:\Users\jkpec\AppData\Roaming\IBM\SPSS Statistics\one\extensions

    However, if you do need to set up or access a separate location for supplemental Python modules, you can create an environment variable named SPSS_EXTENSIONS_PATH pointing to a writable location.  And if you use the STATS PACKAGE INSTALL extension command (from Extensions > Extension Hub), that location will take priority for modules from PyPI.

    --