Ask Your Question
0

Exception Thrown: No installs of PSSE found

asked 2022-06-19 18:45:12 -0500

Dr9 gravatar image

I am trying to run a simple automation script with a sample case but have run into this error from core.py. I've tried implementing pssepath and using the os.environ method and am out of ideas on how to solve this. Any help would be greatly appreciated. I am running PSSE 35.2.

I think that its worth mentioning that I had to manually copy the pssepath folder to the location of my script for python to find it.

My code:

import os,sys

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

import pssepath pssepath.add_pssepath()

import psspy

%%PSS/E Saved case

CASE = r"C:\Program Files\PTI\PSSE35\35.2\EXAMPLE\sample.sav"

if name == 'main':
psspy.psseinit(2000)
psspy.case(CASE) psspy.fnsl(

options1=0, # disable tap stepping adjustment.
options5=0, # disable switched shunt adjustment.   )

Console-

No installs of PSSE found. Stack trace

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\core.py", line 179, in getpssbinpaths_dict

raise PsseImportError("No installs of PSSE found.")

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\helpers.py", line 36, in wrap

cache[key] = fn(args, *kwargs)

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\core.py", line 188, in getpsselocations_dict

pssbinpaths = getpssbinpathsdict()

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\helpers.py", line 36, in wrap

cache[key] = fn(args, *kwargs)

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\core.py", line 232, in add_pssepath

psspypaths = getpsselocationsdict()

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\pssepath\core.py", line 66, in wrapped

fn(args, *kwargs)

File "C:\Users\Darrshen\source\repos\PSSE\PSSE\PSSE.py", line 8, in <module> (Current frame)

pssepath.add_pssepath()

Loaded 'pssepath.core'

Loaded 'pssepath.helpers' Loaded 'main' Loaded 'runpy' The program 'python.exe' has exited with code 0 (0x0).'

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2022-06-20 08:41:36 -0500

jconto gravatar image

After adjusting for v.35.3, the code below runs ok:

import os,sys
# PSSE_LOCATION = r"C:\Program Files\PTI\PSSE35\35.3" 
# sys.path.append(PSSE_LOCATION) 
# os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION
# 
# import pssepath 
# pssepath.add_pssepath()
import psse35
import psspy
psspy.psseinit(2000)

if __name__ == '__main__':
    CASE = r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE\savnw.sav"
    psspy.case(CASE) 
    psspy.fnsl(options1=0, # disable tap stepping adjustment.
               options5=0) # disable switched shunt adjustment.
edit flag offensive delete link more

Comments

That did not fully work but I added the location of psse35.py from python38 and it solved the problem. Now I have a runtime error: bad magic number. Ive switched between python27, 37 and 38 but it did not help.

Dr9 gravatar imageDr9 ( 2022-06-21 00:27:15 -0500 )edit

Reinstall PSSE and install python 3.9.

perolofl gravatar imageperolofl ( 2022-06-21 03:31:23 -0500 )edit

It is a school computer and I don't have the privileges for that. The runtime error might be due to compatibility issues but I have no way of rectifying that.

Dr9 gravatar imageDr9 ( 2022-06-21 12:57:09 -0500 )edit
0

answered 2022-06-20 02:07:21 -0500

perolofl gravatar image

It is not necessary to set the path any longer.

Try:

import psse35
import psspy
psspy.psseinit(2000)
edit flag offensive delete link more

Comments

I tried it and still got the same error.

Dr9 gravatar imageDr9 ( 2022-06-20 03:22:30 -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

1 follower

Stats

Asked: 2022-06-19 18:45:12 -0500

Seen: 35 times

Last updated: Jun 20