1

psspy module not found in PSS/E 34

I am using PSS/E 34 and I have scripts that worked well in version 33. When I use the same script on my cases in version 34 I get the error: "No module named ppspy". I later noticed that this module and the associated drivers were absent in the bin folder. I have reinstalled the application but the problem still persists. There is no information in the documentation that mentions any change in module name or setup. Is there anything I'm missing or this could be a vendor problem?

chaupa's avatar
31
chaupa
asked 2015-11-06 09:53:09 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

5 Answers

3

Starting from v.34 PSSPY is not located at the same path as PSSe, but within its own folder. Use the following code when developing for both v.33 and v.34 (psseversion and pssepath are defined above these code, according to your installation):

if PSSEVERSION==34:
   import psse34               # it sets new path for psspy
else:
   sys.path.append(PSSEPATH]
import psspy
jconto's avatar
2.9k
jconto
answered 2015-11-06 19:46:44 -0500, updated 2016-08-01 20:07:14 -0500
edit flag offensive 0 remove flag delete link

Comments

I was trying to use it for PSSEXplore 34 with the following block of codes. import pssexplore34 exam_path = pssexplore34.EXAM_PATH import psspy psspy.psseinit() But getting the following error. TypeError: _set_psse_loc() got an unexpected keyword argument 'xplore'

Riyasat's avatar Riyasat (2016-06-13 22:48:27 -0500) edit
add a comment see more comments
0

Your reputation indeed does precede you jconto! Thank you so much. It worked perfectly for me.

chaupa's avatar
31
chaupa
answered 2015-11-07 14:26:11 -0500
edit flag offensive 0 remove flag delete link

Comments

The help provide by jconto is extremely useful, thanks to save us always.

vijay's avatar vijay (2017-03-13 01:57:24 -0500) edit
add a comment see more comments
0

hi jconto.

I am trying to learn PSSE and python. Could you please give me the full code to import psspy. I am using PSSE Xplore 34 version.

PradeepSG's avatar
1
PradeepSG
answered 2016-08-02 19:34:15 -0500
edit flag offensive 0 remove flag delete link

Comments

For v.34 I will have, <>=next line: import os, sys<> psseversion = 34<> pssepath = raw"""c:\Program...\PSSe34\bin\""" #according to your installation<> import pss34<> import psspy<>

jconto's avatar jconto (2016-08-03 21:03:00 -0500) edit

Hi Jconto, I also have the same problem with PSSE Xplore 34 (not the standard 34). Does it mean that the PSSE Xplore 34 does not provide the access to use psspy? Could you comment on this? Thanks! Tianyu

Tianyu's avatar Tianyu (2016-08-06 12:19:06 -0500) edit

I am not familiar wth the Xplore 34 version, but I will assume you can still use python and psspy. Check in the "example" folder for *.py files, edit them and run them. See how ppspy is being called. You can always send a message to PTI customer support.

jconto's avatar jconto (2016-08-06 14:40:40 -0500) edit
add a comment see more comments
0

Hi there,

The problem is due to that psspy.pyc is no longer in the same folder as the psse.exe, which is case for older versions.

To import the psspy module of PSSE Xplore 34, you should specify the two paths separately for sys.path and os.environ['PATH']. The following codes work if you installed your PSSE Xplore 34 in the default folder.

import os
import sys
sys_path_PSSE=r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'  #or where else you find the psspy.pyc
sys.path.append(sys_path_PSSE)
os_path_PSSE=r' C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'  # or where else you find the psse.exe
os.environ['PATH'] += ';' + env_path_PSSE
import psspy
Tianyu's avatar
11
Tianyu
answered 2016-12-14 18:00:19 -0500, updated 2016-12-20 14:55:45 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you very much for your kind help in this matter, really appreciate as I was facing same problem.

vijay's avatar vijay (2017-03-13 01:58:09 -0500) edit

How is it solved? What code do I have to change?

Pablo Burgos's avatar Pablo Burgos (2020-11-25 19:30:38 -0500) edit
add a comment see more comments
0

Here is my answer. I modified some different things I found and came up with this. You cannot execute psse34 because that is not the software package available with PSSExplore34. This code is located in the a folder titled "C:\IEEE39".

import os
import sys
import pdb


sys_path_PSSE=r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27'  #or where else you find the psspy.pyc
sys.path.append(sys_path_PSSE)

os_path_PSSE=r'C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN'  # or where else you find the psse.exe
os.environ['PATH'] += ';' + os_path_PSSE
os.environ['PATH'] += ';' + sys_path_PSSE


"""
PYTHONLIB = r'C:\Program Files (x86)\PTI\PSSE34EXplore\PSSLIB'
PYTHONPRM = r'C:\Program Files (x86)\PTI\PSSE34EXplore\PSSPRM'
MODELFOLDER = r'C:\IEEE39'

sys.path.append(PYTHONLIB)
sys.path.append(PYTHONPRM)
"""

import pssexplore34
import pssarrays
import redirect
import dyntools
import bsntools
import psspy

psspy.psseinit(39)

I then moved the pssexplore34.py file to the "C:\IEEE39" folder and commented out the portion of the code that was problematic. I am not sure if this is fool proof, but I am no longer getting the error.

import os, psseloc

_FPTH, _FNAM_EXT = os.path.split(os.path.abspath( __file__ ))
_FNAM, _FEXT     = os.path.splitext(_FNAM_EXT)
_PSSE_VRSN = int(_FNAM[-2:])

#EXAM_PATH = psseloc._set_psse_loc(_PSSE_VRSN, Xplore=True)
TGubitz's avatar
1
TGubitz
answered 2017-04-24 22:21:20 -0500
edit flag offensive 0 remove flag delete link

Comments

This helped me a lot, commenting that last line in pssexplore34.py was key.

jpfize's avatar jpfize (2017-04-26 10:46:52 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer