Ask Your Question

Import redirect module error

asked 2018-05-28 11:53:00 -0500

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"
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?

edit retag flag offensive close merge delete


Do you have redirect.pyc in PSSBIN folder?

perolofl gravatar imageperolofl ( 2018-05-29 07:56:28 -0500 )edit

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

mpski9 gravatar imagempski9 ( 2018-05-29 11:38:42 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-05-29 12:49:57 -0500

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


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

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


Asked: 2018-05-28 11:53:00 -0500

Seen: 816 times

Last updated: May 29 '18