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

Ask Your Question
0

Import redirect module error

asked May 28 '18

mpski9 gravatar image

I am trying to change a .raw file into another form to be used in matlab. I am initializing the program as

import os
import sys
PSSE = r"C:\Program Files (x86)\PTI\PSSEXplore34\PSSBIN"
sys.path.append(PSSE)
os.environ["PATH"] += ";" + PSSE
import redirect 
import psspy

but I am getting the error returned as "ImportError: No module named redirect". How do I install the module redirect? It does not come up as a module when using pip install redirect in command line. How else would I fix this?

Comments

Do you have redirect.pyc in PSSBIN folder?

perolofl gravatar imageperolofl (May 29 '18)

I ended up figuring it out, the redirect.pyc file is in the psspy27 folder instead of pssbin

mpski9 gravatar imagempski9 (May 29 '18)

1 answer

Sort by » oldest newest most voted
0

answered May 29 '18

wassup_doc gravatar image

Depending on which version of Python you are using (e.g. python 2.7.x or Python 3.4.x) you need to setup the following location(s) in your PATH -- they each have a different version of the compiled Python binary 'redirect.pyc'

C:\ ... \PTI\PSSE34\PSSPY34

OR

C:\ ... \PTI\PSSE34\PSSPY27

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: May 28 '18

Seen: 2,073 times

Last updated: May 29 '18