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

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked Mar 1 '2

AML gravatar image

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code: import os import sys syspathPSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc sys.path.append(syspathPSSE) ospathPSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe os.environ['PATH'] += ';' + ospathPSSE os.environ['PATH'] += ';' + syspathPSSE import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 2
No.2 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code: code:

import os import sys syspathPSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc sys.path.append(syspathPSSE) ospathPSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe os.environ['PATH'] += ';' + ospathPSSE os.environ['PATH'] += ';' + syspathPSSE import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 3
No.3 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os os

import sys sys

syspathPSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc psspy.pyc

sys.path.append(syspathPSSE) PSSE)

ospathPSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe psse.exe

os.environ['PATH'] += ';' + ospathPSSE PSSE

os.environ['PATH'] += ';' + syspathPSSE PSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 4
No.4 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

import sys

syspathPSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

sys.path.append(syspathPSSE)

ospathPSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

os.environ['PATH'] += ';' + ospathPSSE

os.environ['PATH'] += ';' + syspathPSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 5
No.5 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

import sys

syspathsys _ path _ PSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

sys.path.append(syspathPSSE)

osos path PSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

os.environ['PATH'] += ';' + ospathPSSE

os.environ['PATH'] += ';' + syspathPSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 6
No.6 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

import sys

sys _ path _ PSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

sys.path.append(syspathPSSE)

os path _ path _ PSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

os.environ['PATH'] += ';' + ospathPSSE

os.environ['PATH'] += ';' + syspathPSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 7
No.7 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

import sys

sys _ path _ PSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

sys.path.append(syspathPSSE)

os _ path _ PSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

os.environ['PATH'] += ';' + ospathos _ path _ PSSE

os.environ['PATH'] += ';' + syspathsys _ path _ PSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 8
No.8 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

import sys

sys _ path _ PSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

sys.path.append(syspathPSSE)

os _ path _ PSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

os.environ['PATH'] += ';' + os _ path _ PSSE

os.environ['PATH'] += ';' + sys _ path _ PSSE

import psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.

click to hide/show revision 9
No.9 Revision

Python cannot import psspy

Hello everyone, My python version is 3.4.0, PSSE version is 34, I look all of the forum article but questions still here. This is my code:

import os

os import sys

import sys

sys _ path _ PSSE=r'C:/Program sys_path_PSSE=r'C:/Program Files (x86)/PTI/PSSE34/PSSPY27' #or where else you find the psspy.pyc

psspy.pyc sys.path.append(sys_path_PSSE)

sys.path.append(syspathPSSE)

os _ path _ PSSE=r' os_path_PSSE=r' C:/Program Files (x86)/PTI/PSSE34/PSSBIN' # or where else you find the psse.exe

psse.exe

os.environ['PATH'] += ';' + os _ path _ PSSE

os_path_PSSE

os.environ['PATH'] += ';' + sys _ path _ PSSE

sys_path_PSSE

import psspy

psspy

REEOR:ImportError: bad magic number in 'psspy': b'\x03\xf3\r\n'

Paths of PSSE and psspy are right, version of python and psspy correspond, I can't figure out why this happended.