1

Error running PSSE from Python

Whenever I try to run PSSE from Python I get the following message in the python interpreter:

"Could not find INI file: "ÝÊ.INI" Program will attempt to run anyway...

PSS(R)E University Version 33 Copyright (c) 1976-2013 Siemens Industry, Inc., Power Technologies International (PTI) This program is a confidential unpublished work created and first licensed in 1976. It is a trade secret which is the property of PTI. All use, disclosure, and/or reproduction not specifically authorized by PTI is prohibited. This program is protected under copyright laws of non-U.S. countries and by application of international treaties. All Rights Reserved Under The Copyright Laws."

And then the interpreter stops working.

I'm using Python 2.7 and PSSE University 33. I've already tried to reinstall PSSE , tried with PSSE University 32 and I always get the same error.

Any ideas about whats causing this?

Thanks in advance.

EDIT: This is the code I'm trying to run:

CASE = r"C:\Users\N\Desktop\PDIS\03_10.sav"
psspy.psseinit(5)
psspy.case(CASE)
psspy.fnsl(
options1=0,
options5=0,
)
Onun's avatar
11
Onun
asked 2013-10-17 06:02:18 -0500, updated 2013-10-18 11:43:23 -0500
edit flag offensive 0 remove flag close merge delete

Comments

How are you initializing the solution engine?

jsexauer's avatar jsexauer (2013-10-18 11:16:08 -0500) edit

What do you mean with "solution engine"? I edited my inicial post with the code I'm trying to run.

Onun's avatar Onun (2013-10-18 11:40:19 -0500) edit

Looks like you're doing it right. I just wanted to make sure you were using `psspy.psseinit()`. Although I would try a bigger value than 5, although I wouldn't think this would cause the issue you're seeing.

jsexauer's avatar jsexauer (2013-10-18 15:07:16 -0500) edit

You say that you are running from Python, in which case you may need to set up the correct environment variables (we've found this is the case for us): http://www.whit.com.au/blog/2011/07/run-psse-from-python-and-not-other-way/ I wrote with some example code there

JervisW's avatar JervisW (2013-10-19 21:09:34 -0500) edit
add a comment see more comments

3 Answers

0

Here is how load psse from python on a 64 bit windows machine:

import os,sys

PSSE_LOCATION = r"C:\Program Files (x64)\PTI\PSSE33\PSSBIN"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + ';' +  PSSE_LOCATION

Put that at the top of your file. It will set your Python path and your os environment variables. Particularly the environment variables are important otherwise PSS/E will crash when you try to actually solve something or load data.

JervisW's avatar
1.3k
JervisW
answered 2013-10-19 21:11:36 -0500
edit flag offensive 0 remove flag delete link

Comments

I was already including that on the top of the file. When I run it I have the same problem. I think that the key to my problem is that message saying that is missing an ".ini" file. I'm using a 64 bit version of windows 8, and my PSSE location is "C:\Program Files (x86)\PTI\PSSEUniversity33\PSSBIN

Onun's avatar Onun (2013-10-20 16:05:55 -0500) edit
add a comment see more comments
0

You have to redirect PSS/E to Python, See the modified code below:

CASE = r"C:\Users\N\Desktop\PDIS\03_10.sav" import redirect redirect.psse2py() psspy.psseinit(5) psspy.case(CASE) psspy.fnsl( options1=0, options5=0, )

Regards Nagaraj Neradhala

Nagaraj Neradhala's avatar
1
Nagaraj Neradhala
answered 2017-01-07 09:41:09 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

I got the PSSE running. I dont know if I was making a noob mistake trying to run it trough Spyder, but when I tried to run it directly in a Python Interpreter I've managed it to work.

So now my question is:

It is not possible to run PSSE trough Python trough Spyder?

Thanks for all the answers who led me to find a solution !

Onun's avatar
11
Onun
answered 2013-10-20 16:24:29 -0500
edit flag offensive 0 remove flag delete link

Comments

2

Are you using Spyder as part of the WinPython toolset by any chance? It could be the version of python Spyder is using and the version of python that you launched when opening the interpreter are different.

jsexauer's avatar jsexauer (2013-10-21 07:13:38 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer