First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

psspy module not found in PSS/E 34

asked Nov 6 '15

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?

5 answers

Sort by » oldest newest most voted
3

answered Nov 7 '15

jconto gravatar image

updated Aug 2 '16

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
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 gravatar imageRiyasat (Jun 14 '16)
0

answered Dec 15 '16

Tianyu gravatar image

updated Dec 20 '16

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
link

Comments

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

vijay gravatar imagevijay (Mar 13 '17)

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

Pablo Burgos gravatar imagePablo Burgos (Nov 26 '0)
0

answered Apr 25 '17

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

Comments

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

jpfize gravatar imagejpfize (Apr 26 '17)
0

answered Nov 7 '15

chaupa gravatar image

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

link

Comments

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

vijay gravatar imagevijay (Mar 13 '17)
0

answered Aug 3 '16

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.

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 gravatar imagejconto (Aug 4 '16)

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 (Aug 6 '16)

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 (Aug 6 '16)

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

2 followers

Stats

Asked: Nov 6 '15

Seen: 13,812 times

Last updated: Apr 24 '17