Ask Your Question
1

psspy module not found in PSS/E 34

asked 2015-11-06 09:53:09 -0600

chaupa gravatar image

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?

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
3

answered 2015-11-06 19:46:44 -0600

jconto gravatar image

updated 2016-08-01 20:07:14 -0600

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
edit flag offensive delete link more

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 gravatar imageRiyasat ( 2016-06-13 22:48:27 -0600 )edit
0

answered 2016-12-14 18:00:19 -0600

Tianyu gravatar image

updated 2016-12-20 14:55:45 -0600

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
edit flag offensive delete link more

Comments

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

vijay gravatar imagevijay ( 2017-03-13 01:58:09 -0600 )edit

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

Pablo Burgos gravatar imagePablo Burgos ( 2020-11-25 19:30:38 -0600 )edit
0

answered 2017-04-24 22:21:20 -0600

TGubitz gravatar image

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)
edit flag offensive delete link more

Comments

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

jpfize gravatar imagejpfize ( 2017-04-26 10:46:52 -0600 )edit
0

answered 2015-11-07 14:26:11 -0600

chaupa gravatar image

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

edit flag offensive delete link more

Comments

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

vijay gravatar imagevijay ( 2017-03-13 01:57:24 -0600 )edit
0

answered 2016-08-02 19:34:15 -0600

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.

edit flag offensive delete link more

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 gravatar imagejconto ( 2016-08-03 21:03:00 -0600 )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 gravatar imageTianyu ( 2016-08-06 12:19:06 -0600 )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 gravatar imagejconto ( 2016-08-06 14:40:40 -0600 )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

2 followers

Stats

Asked: 2015-11-06 09:53:09 -0600

Seen: 13,750 times

Last updated: Apr 24 '17