Ask Your Question
0

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

edit retag flag offensive close merge delete

Comments

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
0

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

OR

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

Stats

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

Seen: 1,736 times

Last updated: May 29 '18