First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

Python 2.3 on PSSE 30

asked May 7 '12

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.

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 (May 7 '12)

3 answers

Sort by » oldest newest most voted
1

answered May 7 '12

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.

link

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 (May 14 '12)
1

answered May 14 '12

Fagundes gravatar image

updated May 15 '12

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])
link

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 (May 15 '12)

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 (May 16 '12)

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

JervisW gravatar imageJervisW (May 17 '12)
0

answered Dec 29 '18

goodjkchoi gravatar image

updated Dec 29 '18

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.

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: May 7 '12

Seen: 2,290 times

Last updated: Dec 28 '18