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

Ask Your Question
1

Error running PSSE from Python

asked Oct 17 '13

Onun gravatar image

updated Oct 18 '13

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,
)

Comments

How are you initializing the solution engine?

jsexauer gravatar imagejsexauer (Oct 18 '13)

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

Onun gravatar imageOnun (Oct 18 '13)

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 gravatar imagejsexauer (Oct 18 '13)

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 gravatar imageJervisW (Oct 20 '13)

3 answers

Sort by » oldest newest most voted
0

answered Jan 7 '17

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

link
0

answered Oct 20 '13

JervisW gravatar image

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.

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 gravatar imageOnun (Oct 20 '13)
0

answered Oct 20 '13

Onun gravatar image

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 !

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 gravatar imagejsexauer (Oct 21 '13)

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: Oct 17 '13

Seen: 3,208 times

Last updated: Jan 07 '17