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

Ask Your Question
2

Message: "ImportError: No module named redirect"

asked Oct 29 '12

Mongo gravatar image

updated Oct 30 '12

JervisW gravatar image

Hi friends,

I have a new computer, please, when trying to run PSS/E from Python's IDLE, I get this message:

ImportError: No module named redirect

This is my full header:

import os,sys
sys.path.insert(0,'C:\\Program Files\\PTI\\PSSE33\\PSSBIN')
os.environ['PATH'] = 'C:\\Program Files\\PTI\\PSSE33\\PSSBIN'+';'+os.environ['PATH']
import redirect
redirect.psse2py()
import psspy
psspy.psseinit(150000)
_i=psspy.getdefaultint()
_f=psspy.getdefaultreal()
_s=psspy.getdefaultchar()
import excelpy

Please, does anyone know how to fix it ? Do I have to "install" the redirect module ? if so, please how ?

Thanks,

Andre

Comments

2

I have figured out the error, my new machine is a 64-bit one and so PSS/E is in the x86 folder, Thanks, Andre

Mongo gravatar imageMongo (Oct 29 '12)

1 answer

Sort by » oldest newest most voted
1

answered Oct 30 '12

JervisW gravatar image

Hi Andre,

I see that you already worked out the answer. Just in case anyone else was having the same problem. Here is how to import if you are on a 64bit machine.

import os,sys
PSSE_PATH = r'c:\Program Files (x86)\PTI\PSSE33\PSSBIN'
sys.path.append(PSSE_PATH)
os.environ['PATH'] += ';' + PSSE_PATH

import redirect
redirect.psse2py()
import psspy
import excelpy

PSSE is installed in the "Program Files (x86)" folder not the "Program Files" folder for 64bit windows systems.

There are other ways to set up your PSSE path too. Check out this answer by chip for importing psspy

link

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

Stats

Asked: Oct 29 '12

Seen: 4,597 times

Last updated: Oct 29 '12