Ask Your Question
2

Message: "ImportError: No module named redirect"

asked 2012-10-29 14:26:48 -0500

Mongo gravatar image

updated 2012-10-29 18:18:22 -0500

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

edit retag flag offensive close merge delete

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 ( 2012-10-29 15:07:14 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-10-29 18:29:12 -0500

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

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

Stats

Asked: 2012-10-29 14:26:48 -0500

Seen: 4,563 times

Last updated: Oct 29 '12