Ask Your Question
0

import psspy

asked 2019-01-11 15:56:33 -0500

Rashid gravatar image

Hi, I am a beginner for python and psse. I have psse34explore. when I put the playback code into the psse, it runs and ok. but when run it independently from the psse, it gives me some errors. like ImportError: No module named psspy and psscommon. Could anyone help me? Thank you.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2019-01-14 11:39:15 -0500

rafaels100 gravatar image

updated 2019-01-21 14:11:28 -0500

jconto gravatar image

At the beggining of the code you need to have something like this :

#import standard libraries
import os, sys
#add psspy to the path
sys.path.append(r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN")
os.environ['PATH'] = (r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN;"
                      + os.environ['PATH'])
sys.path.append(r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27")
os.environ['PATH'] = (r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27;"
                      + os.environ['PATH'])

#imported libraries for psse
import psspy
from psspy import _i
from psspy import _f
from psspy import _s
import redirect

It doesnt necessarily has to look like this, but check your folders and try in every folder related to psse and python til you find the one which contains the psspy. In my case the standard code didnt work in all my computers, but after trying many directories (folders) I was able to make it work everytime.

edit flag offensive delete link more
0

answered 2019-01-14 12:34:39 -0500

Rashid gravatar image

Thank you rafael. It solves my problem.

edit flag offensive delete link more

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: 2019-01-11 15:56:33 -0500

Seen: 1,831 times

Last updated: Jan 21 '19