Topic
  • 20 replies
  • Latest Post - ‏2013-05-22T17:28:24Z by JonPeck
SystemAdmin
SystemAdmin
2077 Posts

Pinned topic Problems running TURF in SPSS 18

‏2010-04-09T19:34:52Z |
I installed the Python Plug-in and can access the TURF analysis function within the descriptive statistics.  I initially got an error message about the SPSS INC command name not being recognized but I read about a fix for that in another forum topic and got past that.  However now when I try to run the TURF I get the following error message:

Extension command SPSSINC_TURF could not be loaded. The module or a module that it requires may be missing, or there may be syntax errors in it.

Any help would be greatly appreciated.

Tom

Updated on 2012-06-14T21:19:13Z at 2012-06-14T21:19:13Z by stevehollingshead
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Problems running TURF in SPSS 18

    ‏2010-04-09T21:19:36Z  
    Most likely the SPSSINC_TURF.py file is not in the right place. Run this program to get a more detailed error message.

    begin program.

    import spss, SPSSINC_TURF

    end program.


    That will tell you why the module cannot be loaded.


    HTH,

    Jon Peck
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Problems running TURF in SPSS 18

    ‏2010-04-09T23:52:52Z  
    Sounds like you are right.  I got the following:

    ImportError: No module named SPSSINC_TURF

    So I found the file in question within the zip file I downloaded, where should I put it to make it work?

  • SystemAdmin
    SystemAdmin
    2077 Posts

    Problems running TURF in SPSS 18

    ‏2010-04-09T23:56:48Z  
    Save the file in the extensions subdirectory of your SPSS installation. If you are on v17, you may need to put it in c:/python25/lib/site-packages. I forget whether we added the extensions directory to the search path in that version or not. Be sure to preserve the case of the file name. It must be

    SPSSINC_TURF.py. The readme file has the full installation instructions.


    HTH,

    Jon
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Problems running TURF in SPSS 18

    ‏2010-04-10T00:21:53Z  
    Got it.  Thanks so much. This is awesome!
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-03T13:25:21Z  
    Save the file in the extensions subdirectory of your SPSS installation. If you are on v17, you may need to put it in c:/python25/lib/site-packages. I forget whether we added the extensions directory to the search path in that version or not. Be sure to preserve the case of the file name. It must be

    SPSSINC_TURF.py. The readme file has the full installation instructions.


    HTH,

    Jon
    Hello,

    I had a similiar problem. Have followed the instructions above and got stuck on something like that:

    SPSSINC TURF VARIABLES = var1 var2 var3
    /OPTIONS BESTN = 2 NUMBERTODISPLAY = 2 THRESHOLD = 30 CRITERIA = 2
    REMOVALCYCLES = 0. MAXSETS=5000000.
    File "<string>", line 4
    sys.path.insert(0,r'C:\Python26\Lib\site-packages\')
    ^
    SyntaxError: EOL while scanning string literal
    ----

    any ideas?
    ~letko
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-03T13:41:56Z  
    • letko
    • ‏2011-08-03T13:25:21Z
    Hello,

    I had a similiar problem. Have followed the instructions above and got stuck on something like that:

    SPSSINC TURF VARIABLES = var1 var2 var3
    /OPTIONS BESTN = 2 NUMBERTODISPLAY = 2 THRESHOLD = 30 CRITERIA = 2
    REMOVALCYCLES = 0. MAXSETS=5000000.
    File "<string>", line 4
    sys.path.insert(0,r'C:\Python26\Lib\site-packages\')
    ^
    SyntaxError: EOL while scanning string literal
    ----

    any ideas?
    ~letko
    It looks like you may have some Python code in your syntax window in addition to the TURF command. Can you post a more complete listing of your input? The TURF command should be treated as regular syntax.
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-03T13:55:36Z  
    It looks like you may have some Python code in your syntax window in addition to the TURF command. Can you post a more complete listing of your input? The TURF command should be treated as regular syntax.
    I try to do this analysis through the dialog box. After pasting the command is in the form (nothing else):

    SPSSINC TURF VARIABLES = var1 var2 var3
    /OPTIONS BESTN = 2 NUMBERTODISPLAY = 2 THRESHOLD = 30 CRITERIA = 2
    REMOVALCYCLES = 0. MAXSETS=5000000.
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-03T14:00:56Z  
    • letko
    • ‏2011-08-03T13:55:36Z
    I try to do this analysis through the dialog box. After pasting the command is in the form (nothing else):

    SPSSINC TURF VARIABLES = var1 var2 var3
    /OPTIONS BESTN = 2 NUMBERTODISPLAY = 2 THRESHOLD = 30 CRITERIA = 2
    REMOVALCYCLES = 0. MAXSETS=5000000.
    That's weird. There is no line of code in either TURF or the Python plugin that it uses that looks like the error line reported as far as I can see. What version of Statistics are you using, and on what platform?

    Try this simple program for diagnostic purposes.
    begin program.
    import spss
    print "ok"
    end program.
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T06:32:31Z  
    That's weird. There is no line of code in either TURF or the Python plugin that it uses that looks like the error line reported as far as I can see. What version of Statistics are you using, and on what platform?

    Try this simple program for diagnostic purposes.
    begin program.
    import spss
    print "ok"
    end program.
    The diagnostic feedback is "ok".
    I'm using SPSS v.18.0.0. on Windows XP + Python 2.6.
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T07:05:46Z  
    • letko
    • ‏2011-08-04T06:32:31Z
    The diagnostic feedback is "ok".
    I'm using SPSS v.18.0.0. on Windows XP + Python 2.6.
    I updated SPSS to version 18.0.3. Still the same.
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T12:44:52Z  
    • letko
    • ‏2011-08-04T07:05:46Z
    I updated SPSS to version 18.0.3. Still the same.
    This is interesting. After restarting the system the message is as follows:
    ---

    begin program.
    import spss
    print "ok"
    end program.
    File "<string>", line 2
    import spss
    ^
    IndentationError: unexpected indent

    ---
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T13:00:34Z  
    You need to put the SPSSINC_TURF.py as well as SPSSINC_TURF.xml in the extensions subdirectory under your Statistics installation. You can test whether that is the problem by doing this - do not indent anything. Your indentation is why the test job I suggested failed.

    begin program.
    import spss
    import SPSSINC_TURF
    end program.

    That will either tell you that it could not find the .py file, or it will report some other error when importing that file.

    HTH,
    Jon Peck
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T13:14:51Z  
    You need to put the SPSSINC_TURF.py as well as SPSSINC_TURF.xml in the extensions subdirectory under your Statistics installation. You can test whether that is the problem by doing this - do not indent anything. Your indentation is why the test job I suggested failed.

    begin program.
    import spss
    import SPSSINC_TURF
    end program.

    That will either tell you that it could not find the .py file, or it will report some other error when importing that file.

    HTH,
    Jon Peck
    TURF is already running. I forgot that i added environment variable on Windows system. I removed it and it's ok, the analysis is performed.

    However, the response of checking command looks like this:
    --

    begin program.
    import spss
    import SPSSINC_TURF
    end program..
    File "<string>", line 2
    import spss
    ^
    IndentationError: unexpected indent

    --
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T13:42:18Z  
    • letko
    • ‏2011-08-04T13:14:51Z
    TURF is already running. I forgot that i added environment variable on Windows system. I removed it and it's ok, the analysis is performed.

    However, the response of checking command looks like this:
    --

    begin program.
    import spss
    import SPSSINC_TURF
    end program..
    File "<string>", line 2
    import spss
    ^
    IndentationError: unexpected indent

    --
    As I said, don't indent like that. Indentation has specific meaning in Python.
  • letko
    letko
    7 Posts

    Re: Problems running TURF in SPSS 18

    ‏2011-08-04T13:51:52Z  
    As I said, don't indent like that. Indentation has specific meaning in Python.
    Ok,
    thanks for your interest.

    letko
  • gtimpany
    gtimpany
    1 Post

    Re: Problems running TURF in SPSS 20

    ‏2011-10-28T19:02:32Z  
    Just received my update to SPSS v20. As usual I too am having problems running TURF. I receive this error:

    Error # 1. Command name: SPSSINC
    >The first word in the line is not recognized as an SPSS Statistics command.
    >Execution of this command stops.
    /OPTIONS BESTN = 3 NUMBERTODISPLAY = 3 CRITERIA = 1
    REMOVALCYCLES = 0. MAXSETS=5000000.

    Seems to be consistent with the errors others have received from prior versions.

    Any thoughts?

    thanks!

    Greg
  • SystemAdmin
    SystemAdmin
    2077 Posts

    Re: Problems running TURF in SPSS 20

    ‏2011-10-28T19:19:54Z  
    • gtimpany
    • ‏2011-10-28T19:02:32Z
    Just received my update to SPSS v20. As usual I too am having problems running TURF. I receive this error:

    Error # 1. Command name: SPSSINC
    >The first word in the line is not recognized as an SPSS Statistics command.
    >Execution of this command stops.
    /OPTIONS BESTN = 3 NUMBERTODISPLAY = 3 CRITERIA = 1
    REMOVALCYCLES = 0. MAXSETS=5000000.

    Seems to be consistent with the errors others have received from prior versions.

    Any thoughts?

    thanks!

    Greg
    This indicates that the xml file that defines the SPSSINC TURF syntax was not found where expected. If you are on Vista or Win7, did you install the Python Extensions with Run As Administrator?

    If not, see if you have the file SPSSINC_TURF.xml in the extensions subdirectory of your Statistics installation.

    Regards,
    Jon Peck
  • stevehollingshead
    stevehollingshead
    1 Post

    Re: Problems running TURF in SPSS 20

    ‏2012-06-14T21:19:13Z  
    This indicates that the xml file that defines the SPSSINC TURF syntax was not found where expected. If you are on Vista or Win7, did you install the Python Extensions with Run As Administrator?

    If not, see if you have the file SPSSINC_TURF.xml in the extensions subdirectory of your Statistics installation.

    Regards,
    Jon Peck
    Jon,

    in our case we run windows 7 32 bit, turning UAC off completely and reinstalling the python extensions seemed to do the trick. Just right clicking and running as administrator did not work. With UAC off, it may have also escalated something else that let this run properly.
    So before installing anything I would recommend turning user account control to never notify, until the developer tools are windows 7 ready.
  • Anke2
    Anke2
    1 Post

    Re: Problems running TURF in SPSS 21

    ‏2013-05-22T05:07:34Z  

    I have tried everything mentioned in the previous posts and I am still not able to run the TURF analysis program. I get this error message:

    >Warning # 6894. Command name: BEGIN PROGRAM

    The external program exit unexpectedly and lost its content, a new external

    program will startup to execute the rest of job.

    Suggestions would be appreciated

  • JonPeck
    JonPeck
    365 Posts

    Re: Problems running TURF in SPSS 21

    ‏2013-05-22T17:28:24Z  
    • Anke2
    • ‏2013-05-22T05:07:34Z

    I have tried everything mentioned in the previous posts and I am still not able to run the TURF analysis program. I get this error message:

    >Warning # 6894. Command name: BEGIN PROGRAM

    The external program exit unexpectedly and lost its content, a new external

    program will startup to execute the rest of job.

    Suggestions would be appreciated

    Does this happen with every TURF attempt?  Can you try a really small example?  Unfortunately the error message you cite provides no helpful information in figuring out the cause.  If you want to send me your data and syntax (peck AT us.ibm.com), I can try to diagnose this.  Please confirm that you are using V21 and have installed the fixpacks for both Statistics itself and the Python Essentials.