Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unable to import psse34/psspy from Anaconda2.7 32bit python interpreter

While I am able to import psse34/psspy from IDLE (the built-in python interpreter of PSSE), I am not able to do so from Anaconda interpreters. I have appended PSSPY34 path to the python system path, and also added PSSBIN to the OS path variable, but no luck. I tried with all different versions of anaconda: 32/64 bit and 2.7/3.7 python. But I am getting the same error for all versions: 'ImportError: Bad magic number in psspy.pyc' in case of importing psspy, and 'ImportError: Bad magic number in pssloc.pyc' in case of importing psse34. Has anyone able to run PSSE34 from Anaconda before?

Unable to import psse34/psspy from Anaconda2.7 32bit python interpreter

While I am able to import psse34/psspy from IDLE (the built-in python interpreter of PSSE), I am not able to do so from Anaconda interpreters. I have appended PSSPY34 path to the python system path, and also added PSSBIN to the OS path variable, but no luck. I tried with all different versions of anaconda: 32/64 bit and 2.7/3.7 python. But I am getting the same error for all versions: 'ImportError: Bad magic number in psspy.pyc' in case of importing psspy, and 'ImportError: Bad magic number in pssloc.pyc' in case of importing psse34. Has anyone able to run PSSE34 from Anaconda before?

Code:

(base) C:>python

Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 15:49:40) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import os

import sys

psse_path = r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN"

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

pssepythonpath = r"C:\Program Files (x86)\PTI\PSSE34\PSSPY34"

sys.path.append(pssepythonpath)

import psse34

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psse34.py", line 24, in <module> import os, psseloc

ImportError: Bad magic number in C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psseloc.pyc

import psspy

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ImportError: Bad magic number in C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psspy.pyc

>

Unable to import psse34/psspy from Anaconda2.7 32bit python interpreter

While I am able to import psse34/psspy from IDLE (the built-in python interpreter of PSSE), I am not able to do so from Anaconda interpreters. I have appended PSSPY34 path to the python system path, and also added PSSBIN to the OS path variable, but no luck. I tried with all different versions of anaconda: 32/64 bit and 2.7/3.7 python. But I am getting the same error for all versions: 'ImportError: Bad magic number in psspy.pyc' in case of importing psspy, and 'ImportError: Bad magic number in pssloc.pyc' in case of importing psse34. Has Is anyone able to run PSSE34 from Anaconda before?

Code:

(base) C:>python

Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 15:49:40) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import os

import sys

psse_path = r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN"

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

pssepythonpath = r"C:\Program Files (x86)\PTI\PSSE34\PSSPY34"

sys.path.append(pssepythonpath)

import psse34

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psse34.py", line 24, in <module> import os, psseloc

ImportError: Bad magic number in C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psseloc.pyc

import psspy

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ImportError: Bad magic number in C:\Program Files (x86)\PTI\PSSE34\PSSPY34\psspy.pyc

>