problem with python code-installation spss 20

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with python code-installation spss 20

progster
Dear all,
I launched the SPSS_Statistics_PythonEssentials_20002_win64 installation files in order to install Python in my SPSS 20.
The installation ended without any warning.
Then I tried this simple code from the pdf guide:


DATA LIST FREE /var1.
BEGIN DATA
1
END DATA.
DATASET NAME File1.
BEGIN PROGRAM PYTHON.
import spss
File1N=spss.GetVariableCount()
END PROGRAM.

DATA LIST FREE /var1 var2 var3.
BEGIN DATA
1 2 3
END DATA.
DATASET NAME File2.
BEGIN PROGRAM PYTHON.
File2N=spss.GetVariableCount()
if File2N > File1N:
message="File2 has more variables than File1."
elif File1N > File2N:
message="File1 has more variables than File2."
else:
message="Both files have the same number of variables."
print message
END PROGRAM.

In the log I see this:

BEGIN PROGRAM PYTHON.
 166  0 M>  BEGIN PROGRAM PYTHON.
import spss
File1N=spss.GetVariableCount()
END PROGRAM.

Error # 6886.  Command name: BEGIN PROGRAM
The External Program could not be loaded.
Execution of this command stops.
Load library from InvokePython failed.


Do you know how I could fix the problem?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: problem with python code-installation spss 20

Jignesh Sutar
Does this error message occur even after re-starting the PC after installation?
Reply | Threaded
Open this post in threaded view
|

Re: problem with python code-installation spss 20

progster
yes it does.

actually it creates the dataset, but no more actions.
Reply | Threaded
Open this post in threaded view
|

Re: problem with python code-installation spss 20

progster
it was a 32bit vs 64 bit issue.

my bad, sorry.

now it works