1

Import psspy returns error: DLL load failed

I have installed PSS34. The installation GUI has installed Python 2.7 and I have included that address in my code.

import os
import sys
import xlwt
import xlrd
import scipy.io

# Importing the psspy run PSSE
PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSEXplore34\PSSPY27"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION
print('sys.path')
import psspy

The Python code is called within MATLAB and psspy.pyc exists in PSSPY27 folder. But it returns the following error:

File ".\psspy.py", line 56, in <module> ImportError: DLL load failed: The specified module could not be found.

Shahab Mehraeen's avatar
13
Shahab Mehraeen
asked 2023-10-24 19:34:15 -0500
jconto's avatar
2.9k
jconto
updated 2023-10-25 09:54:24 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

can you run the same scripts outside matlab? Just open a DOS windows using the link "PSSE 34 Command Prompt" and run it.

My guess is that psspy cannot run within the matlab environment.

jconto's avatar
2.9k
jconto
answered 2023-10-25 09:58:37 -0500
edit flag offensive 0 remove flag delete link

Comments

Yes, I tried and it gives the same error. I installed the same package on a different computer and there was no error.

Shahab Mehraeen's avatar Shahab Mehraeen (2023-10-25 13:42:09 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer