When you installed STAF, did you select the Python 2.6 support as the 
default?  STAF installs Python libraries for Python 2.2, 2.3, 2.4., 2.5, 
and 2.6 on Linux, and Python 2.2 is the default.  So if you ran the 
following, 

# export PYTHONPATH=/usr/local/staf/lib

# /opt/Python-2.6/bin/python test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from PySTAF import *
  File "/usr/local/staf/lib/PySTAF.py", line 9, in <module>
    import PYSTAF
ImportError: /usr/local/staf/lib/PYSTAF.so: undefined symbol: 
Py_InitModule4
 
Note you get this error since PYTHONPATH was set to /usr/local/staf/lib, 
which will contain the default PYSTAF.so file (for Python 2.2), and Python 
2.2 and 2.6 are not compatible.

If you change PYTHONPATH to include the Python 2.6 library file 
(/usr/local/staf/lib/python26/PYSTAF.so), then Python 2.6 should work 
fine:

# export PYTHONPATH=/usr/local/staf/lib/python26:/usr/local/staf/lib

# /opt/Python-2.6/bin/python test.py
RC: 0, Result: PONG

Or, you could reinstall STAF and select Python 2.6 as the default.

You can find more information in the STAF Python User's Guide 
(http://staf.sourceforge.net/current/STAFPython.htm) and the STAF 
Installation Guide (http://staf.sourceforge.net/current/STAFInstall.pdf).

Thanks, 
David 

David Bender 
STAF/STAX Development 
IBM Software Group, WPLC 
 
11501 Burnet Rd. 
Bldg. 903-5B002 
Austin, TX 78758-3400 
 
Phone (T/L): 1-512-286-5315 (363-5315) 
ITN: 23635315 
Email: bda...@us.ibm.com 
 





Brian Williams <brian.willi...@unboundid.com> 
07/31/2009 02:27 PM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] PySTAF on 64-bit linux: Py_InitModule4 vs  Py_InitModule4_64







Hello,
On 64-bit Ubuntu, with STAF 3.3.4.1 for amd64 and python 2.6.1.

Has anyone encountered a problem importing PySTAF with the missing 
symbol Py_InitModule4?

Apparently on 64-bit linux, in libpython2.[56].so, the symbol is renamed 
to Py_InitModule4_64. 

I receive the following error on import:

    from PySTAF import *
  File "/usr/local/staf/lib/PySTAF.py", line 9, in <module>
    import PYSTAF
ImportError: /usr/local/staf/lib/PYSTAF.so: undefined symbol: 
Py_InitModule4

Thanks,
Brian
[attachment "smime.p7s" deleted by David Bender/Austin/IBM] 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
30-Day 
trial. Simplify your report design, integration and deployment - and focus 
on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to