I am trying to run python in SPSS syntax.
The purpose is to find out how closely the three sources place hospitals by taking the distances. I get this error > >Error # 6890. Command name: begin program > >Configuration file spssdxcfg.ini is invalid. > >Execution of this command stops. > Configration file spssdxcfg.ini is invalid because the LIB_NAME is NULL. data list list/ ID(f3) acc1 (f1) acc2(f1) latitude1 longitude1 latitude2 longitude2 latitude3 longitude3 (6f11.7). begin data. 2 6 8 41.6674894 -70.5158194 41.667489 -70.515819 41.6697540 -70.5155370 20 8 6 42.7115620 -71.0061448 42.711562 -71.006145 42.7110741 -71.0034720 41 9 6 42.3902597 -72.5216735 42.390260 -72.521674 42.3899722 -72.5212817 70 8 9 42.2562632 -71.0792062 42.256263 -71.079206 42.2563830 -71.0792450 104 9 8 42.3936720 -71.0333220 42.393672 -71.033322 42.3936720 -71.0333220 166 8 9 42.2754785 -71.0936511 42.275478 -71.093651 42.2753140 -71.0937040 233 6 8 42.3695410 -71.0366920 42.369541 -71.036692 42.3695327 -71.0366994 308 9 8 42.3085910 -71.1149198 42.308591 -71.114920 42.3085910 -71.1149198 326 5 6 42.3398361 -71.0933014 42.339836 -71.093301 42.3398106 -71.0930371 379 9 8 41.7280625 -70.5854771 41.728063 -70.585477 41.7280625 -70.5854771 421 9 8 41.9373140 -70.0207360 41.937314 -70.020736 41.9373140 -70.0207360 end data. var labels latitude1 'latitude from source 1'/ longitude1 'longitude from source 1'/ latitude2 'latitude from source 2'/ longitude2 'longitude from source 2'/ latitude3 'latitude from source 3'/ longitude3 'longitude from source 3'. numeric dist1_1 dist1_3 dist_2_3 (f10.5). begin program. import spss, spssaux vardict = spssaux.VariableDict() from extendedTransforms import ellipseDist dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude2), float(longitude2), inradians=False))) output.write(dist1_2) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) end program. list /variables = ID dist1_2 dist1_3 dist2_3. -- Art Kendall Social Research Consultants ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants |
That error means that the Python Essentials
are not installed or that there is something wrong with the installation.
If you are on Win7, be sure that you installed the Essentials using Run As Administrator. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Art Kendall <[hidden email]> To: [hidden email] Date: 06/02/2012 12:48 PM Subject: [SPSSX-L] running python from within SPSS Sent by: "SPSSX(r) Discussion" <[hidden email]> I am trying to run python in SPSS syntax. The purpose is to find out how closely the three sources place hospitals by taking the distances. I get this error > >Error # 6890. Command name: begin program > >Configuration file spssdxcfg.ini is invalid. > >Execution of this command stops. > Configration file spssdxcfg.ini is invalid because the LIB_NAME is NULL. data list list/ ID(f3) acc1 (f1) acc2(f1) latitude1 longitude1 latitude2 longitude2 latitude3 longitude3 (6f11.7). begin data. 2 6 8 41.6674894 -70.5158194 41.667489 -70.515819 41.6697540 -70.5155370 20 8 6 42.7115620 -71.0061448 42.711562 -71.006145 42.7110741 -71.0034720 41 9 6 42.3902597 -72.5216735 42.390260 -72.521674 42.3899722 -72.5212817 70 8 9 42.2562632 -71.0792062 42.256263 -71.079206 42.2563830 -71.0792450 104 9 8 42.3936720 -71.0333220 42.393672 -71.033322 42.3936720 -71.0333220 166 8 9 42.2754785 -71.0936511 42.275478 -71.093651 42.2753140 -71.0937040 233 6 8 42.3695410 -71.0366920 42.369541 -71.036692 42.3695327 -71.0366994 308 9 8 42.3085910 -71.1149198 42.308591 -71.114920 42.3085910 -71.1149198 326 5 6 42.3398361 -71.0933014 42.339836 -71.093301 42.3398106 -71.0930371 379 9 8 41.7280625 -70.5854771 41.728063 -70.585477 41.7280625 -70.5854771 421 9 8 41.9373140 -70.0207360 41.937314 -70.020736 41.9373140 -70.0207360 end data. var labels latitude1 'latitude from source 1'/ longitude1 'longitude from source 1'/ latitude2 'latitude from source 2'/ longitude2 'longitude from source 2'/ latitude3 'latitude from source 3'/ longitude3 'longitude from source 3'. numeric dist1_1 dist1_3 dist_2_3 (f10.5). begin program. import spss, spssaux vardict = spssaux.VariableDict() from extendedTransforms import ellipseDist dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude2), float(longitude2), inradians=False))) output.write(dist1_2) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) end program. list /variables = ID dist1_2 dist1_3 dist2_3. -- Art Kendall Social Research Consultants ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
I uninstalled python essentials. Downloaded
SPSS_Statistics_PythonEssentials_20001_win64.exe again.
Reinstalled it running it "as administrator".
I am running version 20.0.01.1. Might something have been changed because I also have Version 21 installed? I now get this message. Warningsdata list list/ ID(f3) acc1 (f1) acc2(f1) latitude1 longitude1 latitude2 longitude2 latitude3 longitude3 (6f11.7). begin data. 2 6 8 41.6674894 -70.5158194 41.667489 -70.515819 41.6697540 -70.5155370 20 8 6 42.7115620 -71.0061448 42.711562 -71.006145 42.7110741 -71.0034720 41 9 6 42.3902597 -72.5216735 42.390260 -72.521674 42.3899722 -72.5212817 70 8 9 42.2562632 -71.0792062 42.256263 -71.079206 42.2563830 -71.0792450 104 9 8 42.3936720 -71.0333220 42.393672 -71.033322 42.3936720 -71.0333220 166 8 9 42.2754785 -71.0936511 42.275478 -71.093651 42.2753140 -71.0937040 233 6 8 42.3695410 -71.0366920 42.369541 -71.036692 42.3695327 -71.0366994 308 9 8 42.3085910 -71.1149198 42.308591 -71.114920 42.3085910 -71.1149198 326 5 6 42.3398361 -71.0933014 42.339836 -71.093301 42.3398106 -71.0930371 379 9 8 41.7280625 -70.5854771 41.728063 -70.585477 41.7280625 -70.5854771 421 9 8 41.9373140 -70.0207360 41.937314 -70.020736 41.9373140 -70.0207360 end data. var labels latitude1 'latitude from source 1'/ longitude1 'longitude from source 1'/ latitude2 'latitude from source 2'/ longitude2 'longitude from source 2'/ latitude3 'latitude from source 3'/ longitude3 'longitude from source 3'. numeric dist1_1 dist1_3 dist_2_3 (f10.5). spssinc trans result=dist1_2 /formula "extendedTransforms.ellipseDist(latitude1, longitude1, latitude2, longitude2, inradians=False)". spssinc trans result=dist1_3 /formula "extendedTransforms.ellipseDist(latitude1, longitude1, latitude3, longitude3, inradians=False)". spssinc trans result=dist2_3 /formula "extendedTransforms.ellipseDist(latitude2, longitude2, latitude3, longitude3, inradians=False)". list /variables = ID dist1_2 dist1_3 dist2_3. Art Kendall Social Research Consultants On 6/2/2012 2:52 PM, Jon K Peck wrote: That error means that the Python Essentials are not installed or that there is something wrong with the installation.===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants |
That error means that things are working!
It got far enough to try to load the extendedTransforms module. You
need to get that from the Community site in the Utilities or Python Modules
collection and save it where Python can find it. site-packages or
the extensions subdirectory under Statistics (if you can write there) or,
if you have set the SPSS_EXTENSIONS_PATH environment variable, any directory
listed there.
V20 and the next one share the same Python installation (though not the actual plugin), so if you need to go back and forth, you will need to edit the spss.pth and SpssClient.pth files to point to the Statistics version you want to use, e.g., spss200. I keep bat files that just switch these files. The first version listed in those files is the one that will be used. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Art Kendall <[hidden email]> To: Jon K Peck/Chicago/IBM@IBMUS Cc: [hidden email] Date: 06/02/2012 02:07 PM Subject: Re: [SPSSX-L] running python from within SPSS I uninstalled python essentials. Downloaded SPSS_Statistics_PythonEssentials_20001_win64.exe again. Reinstalled it running it "as administrator". I am running version 20.0.01.1. Might something have been changed because I also have Version 21 installed? I now get this message. Warnings No module named extendedTransforms data list list/ ID(f3) acc1 (f1) acc2(f1) latitude1 longitude1 latitude2 longitude2 latitude3 longitude3 (6f11.7). begin data. 2 6 8 41.6674894 -70.5158194 41.667489 -70.515819 41.6697540 -70.5155370 20 8 6 42.7115620 -71.0061448 42.711562 -71.006145 42.7110741 -71.0034720 41 9 6 42.3902597 -72.5216735 42.390260 -72.521674 42.3899722 -72.5212817 70 8 9 42.2562632 -71.0792062 42.256263 -71.079206 42.2563830 -71.0792450 104 9 8 42.3936720 -71.0333220 42.393672 -71.033322 42.3936720 -71.0333220 166 8 9 42.2754785 -71.0936511 42.275478 -71.093651 42.2753140 -71.0937040 233 6 8 42.3695410 -71.0366920 42.369541 -71.036692 42.3695327 -71.0366994 308 9 8 42.3085910 -71.1149198 42.308591 -71.114920 42.3085910 -71.1149198 326 5 6 42.3398361 -71.0933014 42.339836 -71.093301 42.3398106 -71.0930371 379 9 8 41.7280625 -70.5854771 41.728063 -70.585477 41.7280625 -70.5854771 421 9 8 41.9373140 -70.0207360 41.937314 -70.020736 41.9373140 -70.0207360 end data. var labels latitude1 'latitude from source 1'/ longitude1 'longitude from source 1'/ latitude2 'latitude from source 2'/ longitude2 'longitude from source 2'/ latitude3 'latitude from source 3'/ longitude3 'longitude from source 3'. numeric dist1_1 dist1_3 dist_2_3 (f10.5). spssinc trans result=dist1_2 /formula "extendedTransforms.ellipseDist(latitude1, longitude1, latitude2, longitude2, inradians=False)". spssinc trans result=dist1_3 /formula "extendedTransforms.ellipseDist(latitude1, longitude1, latitude3, longitude3, inradians=False)". spssinc trans result=dist2_3 /formula "extendedTransforms.ellipseDist(latitude2, longitude2, latitude3, longitude3, inradians=False)". list /variables = ID dist1_2 dist1_3 dist2_3. Art Kendall Social Research Consultants On 6/2/2012 2:52 PM, Jon K Peck wrote: That error means that the Python Essentials are not installed or that there is something wrong with the installation. If you are on Win7, be sure that you installed the Essentials using Run As Administrator. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM peck@... new phone: 720-342-5621 From: Art Kendall <Art@...> To: [hidden email] Date: 06/02/2012 12:48 PM Subject: [SPSSX-L] running python from within SPSS Sent by: "SPSSX(r) Discussion" [hidden email] I am trying to run python in SPSS syntax. The purpose is to find out how closely the three sources place hospitals by taking the distances. I get this error > >Error # 6890. Command name: begin program > >Configuration file spssdxcfg.ini is invalid. > >Execution of this command stops. > Configration file spssdxcfg.ini is invalid because the LIB_NAME is NULL. data list list/ ID(f3) acc1 (f1) acc2(f1) latitude1 longitude1 latitude2 longitude2 latitude3 longitude3 (6f11.7). begin data. 2 6 8 41.6674894 -70.5158194 41.667489 -70.515819 41.6697540 -70.5155370 20 8 6 42.7115620 -71.0061448 42.711562 -71.006145 42.7110741 -71.0034720 41 9 6 42.3902597 -72.5216735 42.390260 -72.521674 42.3899722 -72.5212817 70 8 9 42.2562632 -71.0792062 42.256263 -71.079206 42.2563830 -71.0792450 104 9 8 42.3936720 -71.0333220 42.393672 -71.033322 42.3936720 -71.0333220 166 8 9 42.2754785 -71.0936511 42.275478 -71.093651 42.2753140 -71.0937040 233 6 8 42.3695410 -71.0366920 42.369541 -71.036692 42.3695327 -71.0366994 308 9 8 42.3085910 -71.1149198 42.308591 -71.114920 42.3085910 -71.1149198 326 5 6 42.3398361 -71.0933014 42.339836 -71.093301 42.3398106 -71.0930371 379 9 8 41.7280625 -70.5854771 41.728063 -70.585477 41.7280625 -70.5854771 421 9 8 41.9373140 -70.0207360 41.937314 -70.020736 41.9373140 -70.0207360 end data. var labels latitude1 'latitude from source 1'/ longitude1 'longitude from source 1'/ latitude2 'latitude from source 2'/ longitude2 'longitude from source 2'/ latitude3 'latitude from source 3'/ longitude3 'longitude from source 3'. numeric dist1_1 dist1_3 dist_2_3 (f10.5). begin program. import spss, spssaux vardict = spssaux.VariableDict() from extendedTransforms import ellipseDist dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude2), float(longitude2), inradians=False))) output.write(dist1_2) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) dist.append(str(ellipseDist(float(latitude1), float(longitude1), float(latitude3), float(longitude3), inradians=False))) output.write(dist1_3) end program. list /variables = ID dist1_2 dist1_3 dist2_3. -- Art Kendall Social Research Consultants ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Thank you I have it working. Just one more
question. What is the unit for the output? Kilometers?
Art Kendall Social Research Consultants On 6/2/2012 5:36 PM, Jon K Peck wrote: That error means that things are working! It got far enough to try to load the extendedTransforms module. You need to get that from the Community site in the Utilities or Python Modules collection and save it where Python can find it. site-packages or the extensions subdirectory under Statistics (if you can write there) or, if you have set the SPSS_EXTENSIONS_PATH environment variable, any directory listed there.===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants |
Free forum by Nabble | Edit this page |