This problem is probably because all the environment variables needed for 
STAF are not set correctly in your Eclipse environment (but are set 
correctly in your command line environment).  Re-check that the PATH and 
PYTHONPATH environment variables are set correctly in your Eclipse 
environment.  STAF on Windows requires the PATH environment variable to 
contain the STAF bin directory (e.g. C:\STAF\bin) as documented in section 
"7.1 Environment Variable Settings", sub-section "7.2 Windows" in the STAF 
Installation Guide at http://staf.sourceforge.net/current/STAFInstall.pdf: 
 Also, make sure that your PYTHONPATH environment variable is set 
correctly in your Eclipse environment (e.g. 
C:\STAF\bin\python27;C:\STAF\bin;).


----- Message from Kil Lee <kil....@markit.com> on Fri, 18 Jan 2013 
12:10:47 -0500 -----
To:
"staf-users@lists.sourceforge.net" <staf-users@lists.sourceforge.net>
Subject:
"ImportError" encountered when PySTAF (2.7) imported into Eclipse project

Hi there,
 
ting the following when the below test code is run within the eclipse 
project:
 
    from PySTAF import *
ImportError: dynamic module does not define init function (initPySTAF)
 
However, when the same test code is run within the command prompt, the 
code succeeds.
 
The test code is as follows:
#------------------------------------------------------------------------
from PySTAF import *
import sys
 
try:
  handle = STAFHandle(“MyTest”)
except STAFException as e:
  print("Error registering with STAF, RC: %d, Result: %s" % 
(e.rc,e.result))
  sys.exit(e.rc)
print("Using STAF handle %d" % handle.handle)
result = handle.submit("local", "ping", "ping")
print("STAF local PING PING RC=%d, Result=%s" % (result.rc,result.result))
sys.exit(0)
#------------------------------------------------------------------------
 
The test environment is as follows:
    Windows 7 Professional 64-bit OS
    STAF3412-setup-winamd64.exe
    Python 2.7.2 
    Eclipse SDK v3.6.2
    PyDev for Eclipse 2.7.1
 
As indicated by the successful run using the command prompt, the 
environment variables are:
PYTHONPATH contains C:\STAF\bin\python27;C:\STAF\bin;
and 
PYTHONCASEOK is not set.
 
Thank you in advance.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to