You can easily change which STAF Python library version you want to use on Windows by copying the STAF Python library file for that version to {STAF/Config/STAFRoot}/bin. For example, if STAF is installed at C:\STAF and you want Python 2.7 support:
And to configure STAF Python support on Windiows, add the C:\STAF\bin directory to your environment variable, assuming you installed STAF to directory C:\STAF. For example:
setPYTHONPATH=C:\STAF\bin;%PYTHONPATH%
Last edit: Sharon Lucas 2017-02-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, i did copy (and did the fresh install afterwords), then run the following command inside STAX:
<script>
import sys
print sys.version
</script>
This is the output:
20170213-19:25:23 Info 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) [IBM J9 VM (IBM Corporation)]
So, if this another "python"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I installed STAF with "default" 2.5 python support. How can i change this to 2.7 w/o reinstall?
Thanks.
You can easily change which STAF Python library version you want to use on Windows by copying the STAF Python library file for that version to {STAF/Config/STAFRoot}/bin. For example, if STAF is installed at C:\STAF and you want Python 2.7 support:
This is talked about in section "3.0 Installation" in the STAF Python User's Guide at http://staf.sourceforge.net/current/STAFPython.htm#Header_Install.
And to configure STAF Python support on Windiows, add the C:\STAF\bin directory to your environment variable, assuming you installed STAF to directory C:\STAF. For example:
Last edit: Sharon Lucas 2017-02-13
Actually, i did copy (and did the fresh install afterwords), then run the following command inside STAX:
<script>
import sys
print sys.version
</script>
This is the output:
20170213-19:25:23 Info 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[IBM J9 VM (IBM Corporation)]
So, if this another "python"?
Ok, looks like i mixed things up. STAX uses embedded Jython (2.5) and STAF can do nothing about that. Correct?
Last edit: Sergey 2017-02-13
Right. The STAF Python libraries are not related to the version of Jython that is provided with STAX.
There is a feature open "#739: Update STAX to use Jython 2.7" at https://sourceforge.net/p/staf/feature-requests/739/. However, I haven't had time to work on this more. You could build STAX yourself to use Jython 2.7.(Note: Jython 2.7 requires STAX to be built with Java 6 or later). The STAF Developer's Guide talks about how to build STAX at http://staf.sourceforge.net/current/stafdg.html.
Understood, thanks!