Hi Sharon,
Got it resolved – yes, it was an environmental problem.
Much Thanks,
Kil
From: Sharon Lucas [mailto:luc...@us.ibm.com]
Sent: Friday, January 18, 2013 2:29 PM
To: Kil Lee
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] ImportError" encountered when PySTAF (2.7) imported
into Eclipse project
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<mailto:kil....@markit.com>> on
Fri, 18 Jan 2013 12:10:47 -0500 -----
To:
"staf-users@lists.sourceforge.net<mailto:staf-users@lists.sourceforge.net>"
<staf-users@lists.sourceforge.net<mailto: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<mailto:luc...@us.ibm.com>
(512) 286-7313 or Tieline 363-7313
________________________________
This e-mail, including accompanying communications and attachments, is strictly
confidential and only for the intended recipient. Any retention, use or
disclosure not expressly authorised by Markit is prohibited. This email is
subject to all waivers and other terms at the following link:
http://www.markit.com/en/about/legal/email-disclaimer.page
Please visit http://www.markit.com/en/about/contact/contact-us.page? for
contact information on our offices worldwide.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 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_122412
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users