Ask Your Question
0

Exception Thrown: No installs of PSSE found

asked Jun 20 '2

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).'

2 answers

Sort by » oldest newest most voted
0

answered Jun 20 '2

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.
link

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 (Jun 21 '2)

Reinstall PSSE and install python 3.9.

perolofl gravatar imageperolofl (Jun 21 '2)

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 (Jun 21 '2)
0

answered Jun 20 '2

perolofl gravatar image

It is not necessary to set the path any longer.

Try:

import psse35
import psspy
psspy.psseinit(2000)
link

Comments

I tried it and still got the same error.

Dr9 gravatar imageDr9 (Jun 20 '2)

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

1 follower

Stats

Asked: Jun 20 '2

Seen: 282 times

Last updated: Jun 20 '22