Hi Jon,
I have now stored the config file with same settings at the following locations:
<C:\Program Files\IBM\SPSS\Statistics\27\Python\Lib\site-packages\spss\spssxdcfg.ini>
<C:\Program Files\IBM\SPSS\Statistics\27\Python3\Lib\site-packages\spss\spssxdcfg.ini>
<C:\WinPython-64bit-2.7.10.2_TEST\python-2.7.10.amd64\Lib\site-packages\spss\spssxdcfg.ini>
The last one is my Py2.7 installation.
But, this also doesnt help.
I am not sure, what you mean with "try adding the Statistics installation directory to your system path".
The python sys.path is already extended by sitecustomize.py:
sys.path.append("C:\\Program Files\\IBM\\SPSS\\Statistics\\27\\Python\\Lib\\site-packages\\")
sys.path.append("C:\\Program Files\\IBM\\SPSS\\Statistics\\27\\Python\\Lib\\")
sys.path.append("C:\\Program Files\\IBM\\SPSS\\Statistics\\27\\Python\\")
sys.path.append("C:\\Program Files\\IBM\\SPSS\\Statistics\\27\\")
Without that, Py2.7 will not import any spss module. But that works fine.
Would be glad, if you have any other suggestion or if you could ask the Development team.
Best regards,
Alexander
------------------------------
Alexander Mentrup
(r)evolution GmbH
Bonn
------------------------------
Original Message:
Sent: Wed January 06, 2021 12:32 PM
From: Jon Peck
Subject: Py2.7, SPSS V27, external, "No StartXD.exe file exists"
I think the spssxdcfg.ini file needs to be in the Python\Lib\site-packages\spss directory under your Statistics installation as well as in the corresponding python3 directory.
It shouldn't be necessary, but you might also try adding the Statistics installation directory to your system path.
If these changes don't work, I'll have to ask the Development team what the algorithm for finding the startXD module is.
I have to get the extension command from my old machine, so I'll post that to my OneDrive site later today.
------------------------------
Jon Peck
Original Message:
Sent: Wed January 06, 2021 11:14 AM
From: Alexander Mentrup
Subject: Py2.7, SPSS V27, external, "No StartXD.exe file exists"
Hi Jon,
Thanks for the quick answer.
The Python 2.7 installation is already linked to SPSS V27 via Edit > Options > Files.
Python2.7 code is running well from the syntax editor.
The file "StartXD.exe" exists at <C:\Program Files\IBM\SPSS\Statistics\27\StartXD.exe>.
The config file <C:\Program Files\IBM\SPSS\Statistics\27\Python\Lib\site-packages\spss\spssxdcfg.ini> is also adjusted at line 2:
"spssxd_path=C:\Program Files\IBM\SPSS\Statistics\27"
Should I have to add a Python2.7 path or anything else?
Or do you have any other idea?
I have not tried to use Py3 externally as the other way is currently our priority - although we will migrate totally to Python3 sometime. But, for daily business we need to get the Python 2.7 environment running.
Apart from this, of course I am interested in the extension command for conversion of Python2 code. That would definitely be helpful.
Best regards,
Alexander
------------------------------
Alexander Mentrup
(r)evolution GmbH
Bonn
Original Message:
Sent: Wed January 06, 2021 09:53 AM
From: Jon Peck
Subject: Py2.7, SPSS V27, external, "No StartXD.exe file exists"
I presume that you have installed Python 2.7 and that installation is on your external Python path. If it isn't, you may need to set the PYTHONPATH environment variable. On my new machine I have V27/27.0.1 with Python3 but have avoided installing Python2 as I want to leave that behind. All of the Python- based extension commands were converted to Python3, so if you are using any of those, that should not be a problem. (I did find and report a few cases where that conversion was not 100% correct.)
Check that the Python 2.7 installation works from within SPSS Statistics, possibly after adjusting the setting in Edit > Options > Files.
StartXD.exe should be in the Statistics installation directory.
Look also at the spssdxcfg.ini in that directory to make sure that Python2 is listed.
Also try Python3 externally to see whether that works.
I have an extension command that converts Python2 code to Python3. The conversion doesn't catch everything, but it is a good starting point. It isn't published yet due to problems with the Custom Dialog Builder, but the syntax usage works. I can post it for you if you want to try it out. It will convert Python2 code that is either in standalone .py files (typically a whole directory at once) or embedded in .sps files wrapped in BEGIN/END Python or Python2 blocks.
--
Original Message:
Sent: 1/6/2021 8:18:00 AM
From: Alexander Mentrup
Subject: Py2.7, SPSS V27, external, "No StartXD.exe file exists"
Hi there!
Our company is going to migrate to SPSS V27, however we still have some external code and programs, running from external GUI and written in Python 2.7.
As I understood, it should be possible to use Py2.7 with SPSS V27. I already have created sitecustomize.py to add the paths of the SPSS modules to the sys.path. The modules (e.g. os, sys, wx, spss, spssaux, spssdata) will be loaded, but when spss.py tries to start an instance of SPSS V27 an error message is displayed:
No StartXD.exe file exists
Error.
IBM SPSS Statistics backend is not ready.
This message will be shown when using the following code:
import spss
try:
spss.StartSPSS()
except spss.SpssError:
print "Error."
print spss.GetLastErrorMessage()
Any suggestions how to solve the problem?
Thanks and best regards,
Alexander
------------------------------
Alexander Mentrup, (r)evolution GmbH
------------------------------
#SPSSStatistics