Ask Your Question
1

Error running PSSE from Python

asked 2013-10-17 06:02:18 -0500

Onun gravatar image

updated 2013-10-18 11:43:23 -0500

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,
)
edit retag flag offensive close merge delete

Comments

How are you initializing the solution engine?

jsexauer gravatar imagejsexauer ( 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 gravatar imageOnun ( 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 gravatar imagejsexauer ( 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 gravatar imageJervisW ( 2013-10-19 21:09:34 -0500 )edit

3 answers

Sort by » oldest newest most voted
0

answered 2017-01-07 09:41:09 -0500

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

edit flag offensive delete link more
0

answered 2013-10-19 21:11:36 -0500

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.

edit flag offensive delete link more

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 ( 2013-10-20 16:05:55 -0500 )edit
0

answered 2013-10-20 16:24:29 -0500

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 !

edit flag offensive delete link more

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 ( 2013-10-21 07:13:38 -0500 )edit

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: 2013-10-17 06:02:18 -0500

Seen: 3,049 times

Last updated: Jan 07 '17