Ask Your Question

Soumyabrata Talukder's profile - activity

2020-01-03 00:53:23 -0500 received badge  Famous Question (source)
2019-12-24 05:09:38 -0500 received badge  Notable Question (source)
2019-12-22 10:48:54 -0500 received badge  Popular Question (source)
2019-12-21 14:04:07 -0500 received badge  Editor (source)
2019-12-21 13:49:24 -0500 asked a question 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. 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

>

2019-12-21 13:39:21 -0500 asked a question Has anyone able to import psse34/psspy from Anaconda?

I am trying to interface PSSE34 from Anaconda (since it seems to be a more convenient python interpreter than IDLE). However, in all 32/64 bit and 2.7/3.7 python versions I am getting error in importing psse34/psspy