Ask Your Question
1

Python 2.3 on PSSE 30

asked 2012-05-06 23:37:16 -0500

anonymous user

Anonymous

The following is asked on behalf of @Fagundes I've migrated it from here: http://forum.whit.com.au/psse-help-forum/question/122/how-do-i-import-the-psspy-module-in-a-python?answer=262#post-id-262

Hi.

I'm using PSS/E version 30 and using python 2.3 to program it. Can I use a newer version of python? Is it compatible? I use the code written by JervisW. The code written by me is:

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

print sys.path

Although python reports the following message:

Traceback (most recent call last):

  File "D:\ISEL\TESE\zTestes_python\Testes\teste.py", line 8, in -toplevel-
    import psspy

ImportError: DLL load failed: The specified module could not be found.

If I write the same code but without import pssy, python prints the following paths:

['D:\\ISEL\\TESE\\zTestes_python\\Testes', 
 'D:\\COMPON~1\\PYTHON_2.3\\Lib\\idlelib', 
 'C:\\Windows\\system32\\python23.zip',
 'D:\\COMPON~1\\PYTHON_2.3',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\DLLs',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\plat-win',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\lib-tk',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3',
 'D:\\COMPONENTE_LOGICA\\PYTHON_2.3\\lib\\site-packages',
 'D:\\COMPONENTE_LOGICA\\PSSE\\PSSE30\\PSSBIN']

So he add the path of PSS/E. Can someone tell me what problem might be? I check for a psspy.dll and it exits. But there is no more files with the name psspy.

edit retag flag offensive close merge delete

Comments

I haven't got a copy of PSSE v 30 around to check this out. Does anyone else? Copying files from a later version of PSSE is unlikely to work because of the difference in Python version used.

jtrain gravatar imagejtrain ( 2012-05-06 23:41:01 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2012-05-06 23:47:24 -0500

jtrain gravatar image

I read on Stack Overflow that you can use Dependency Walker on the psspyc.pyd file in the PSSBIN folder.

It should report on the required dlls so you can find which one is missing. It might be a simple problem with the PATH set up.

edit flag offensive delete link more

Comments

Well, in my file PSSBIN there isn't any psspyc.pyd so i guess some file are missing in my PSS30. I will check it out with my friends and see if they have those files.

Fagundes gravatar imageFagundes ( 2012-05-14 12:24:48 -0500 )edit
1

answered 2012-05-14 12:33:02 -0500

Fagundes gravatar image

updated 2012-05-15 00:08:40 -0500

JervisW gravatar image

Well, in my file PSSBIN there isn't any psspyc.pyd so i guess some files are missing in my PSS30. I will check it out with my friends and see if they have those files. Meanwhile, i try python 2.5 with PSS32 student version. Another error appears, i run the code and the follow message appears:

"Messages for api LIST

PSS(R)E not properly initialized"

Thus anyone knows how to solve this problem?

My code was:

import os,sys

sys.path.append(r"D:\COMPONENTE_LOGICA\PTI\PSSEUniversity32\PSSBIN")

os.environ['PATH'] = (r"D:\COMPONENTE_LOGICA\PTI\PSSEUniversity32\PSSBIN"+";"
                      + os.environ['PATH'])


import psspy

import redirect

redirect.psse2py()


psspy.fdns([0,0,0,1,1,0,99,0])
edit flag offensive delete link more

Comments

Between the redirect.psse2py() and the psspy.fdns you will need the following:

psspy.psseinit() psspy.case("d:/case-name.sav")

That will firstly initialise PSSE, and then load a saved case.

JervisW gravatar imageJervisW ( 2012-05-15 00:10:42 -0500 )edit

It work perfectly with PSS/E V32. If i find how to do the same with PSS/E V30 I will post here in case anyone have the same problem.

Fagundes gravatar imageFagundes ( 2012-05-16 13:55:53 -0500 )edit

Great. I'd be pleased to find out about v30 too.

JervisW gravatar imageJervisW ( 2012-05-16 19:26:58 -0500 )edit
0

answered 2018-12-28 19:34:26 -0500

goodjkchoi gravatar image

updated 2018-12-28 21:07:45 -0500

try "import psspy" after add the following path, in which "dsusrnew.dll" exists, as belows

c:>set path=%path%;c:/program files (x86)/pti/psse30/psslib

or

import os os.environ['path'] += os.pathsep + 'c:/program files (x86)/pti/psse30/psslib'

I succeeded import psspy module without errors by this way.

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: 2012-05-06 23:37:16 -0500

Seen: 2,203 times

Last updated: Dec 28 '18