Ask Your Question
0

importing psspy module in a python sript

asked 2014-04-28 17:12:33 -0600

anonymous user

Anonymous

updated 2014-05-29 14:42:06 -0600

jsexauer gravatar image

I use the code

import os,sys

PSSE_LOCATION = r"D:\COMPONENTE_LOGICA\PSSE\PSSE30\PSSBIN"

sys.path.append(PSSE_LOCATION)

os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION 

import psspy

And I get this:

Traceback (most recent call last): File "<console>", line 1, in <module> File ".\psspy.py", line 56, in <module> ImportError: DLL load failed: it is not a valid win32 program

I checkeed the PSSE bin folder and I could not find a psspy.dll. There is a psspyc.pyd. Is the psspy.dll missing? Where can I get one?

edit retag flag offensive close merge delete

Comments

The code looks fine (except for a missing underscore in the first mention of "PSSELOCATION"). Are you using Python 2.3? I haven't tried to call PSSE like this prior to v31. Do you have access to a newer version of PSSE?

Eli Pack gravatar imageEli Pack ( 2014-04-29 22:38:34 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-05-28 15:25:45 -0600

NOC gravatar image

Hi everybody,

I'm using a PSS/E version 32 and in my python programs use the following code:

import os,sys

Path definition to include in the searching paths for the sys library

PATHPSSEINSTALLATION="C:\Program Files (x86)\PTI\PSSE32\PSSBIN" PATHLOCALPROGRAM="D:\MyProgram"

Add path definition to the paths used by sys library

sys.path.append(PATHPSSEINSTALLATION) sys.path.append(PATHLOCALPROGRAM) os.environ['PATH']=os.environ['PATH']+";"+PATHPSSEINSTALLATION

I hope the code be useful for you.

edit flag offensive delete link more
0

answered 2014-05-14 23:49:43 -0600

yfwing gravatar image

Are you using Version 30 or new version? For the version 30 or earlier, it should not use psspyc.pyd. In the PSSBIN folder, you should be able to find a file named psspyc.dll. For version 31 or newer, it uses psspyc.pyd. For the newer release, it has some bugs with win32 compatibility. Upgrade your PSS/E to the Version 33.4, which resolves most of the compatibility issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Stats

Asked: 2014-04-28 17:12:33 -0600

Seen: 1,253 times

Last updated: May 29 '14