First time here? Check out the FAQ!
0

Import psse35, dll fail

I am trying to import and initialize PSSE35. Simply changing paths and system interpreters from what I have for version 34 isn't working.

PSSE version 34 (running with python 39, 32 bit): sys.path.append('C:\Program Files (x86)\PTI\PSSE34\PSSPY39')

PSSE version 35 (running with python 38, 64 bit) sys.path.append('C:\Program Files\PTI\PSSE35\35.2\PSSPY38')

ERROR: Traceback (most recent call last): File "C:/Users/nxt0v07/OneDrive - NEE/Python/Model builder/psse35test.py", line 154, in <module> import psse35 File "C:\Program Files\PTI\PSSE35\35.2\PSSPY38\psse35.py", line 34, in <module> EXAMPATH = psseloc.setpsseloc(svrsn) File ".\psseloc.py", line 384, in _setpsse_loc ImportError: DLL load failed while importing psscommon: The specified module could not be found.

In trying to get PSSE version 35 initialized properly, I tried running with python 39 32 bit and it threw bad magic number errors. I switched to python 38 since it didn't appear that python 39 was installed with my PSSE35 stuff, and it threw win32com errors so I switched to python 38 64 bit. The error above is what I'm trying to debug...

tolemanator's avatar
11
tolemanator
asked 2022-08-23 13:17:35 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

Hi,

I am also facing the same issue. Py39 is not getting installed with PSSE v35, but Py37 and Py38 are. How did you fix this issue? I am getting the exact same error message you recieved.

Thanks in advance, Shahabas

Shahabas's avatar
13
Shahabas
answered 2025-09-11 05:19:33 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

I received this answer in the past: " To initialize PSSe 35.x.y + python 39, the following would work:

import sys, os

#psse_PATH=(r"""C:\\Program Files\\PTI\\PSSE35\\35.3\\PSSBIN""")
pssepy_PATH=(r"""C:\Program Files\PTI\PSSE35\35.3\PSSPY39""")
#sys.path.append(psse_PATH)
#envpath = ';'+psse_PATH
#os.environ['PATH'] += envpath
sys.path.append(pssepy_PATH)
#envpathpy = ';'+pssepy_PATH
#os.environ['PATH'] += envpathpy

import psspy
psspy.psseinit()

or for single v.35 installation:

import sys, os
import psse35
import psspy
psspy.psseinit()

"

juancaquesada's avatar
1
juancaquesada
answered 2022-08-30 14:46:30 -0500
jconto's avatar
2.9k
jconto
updated 2022-08-30 17:58:03 -0500
edit flag offensive 0 remove flag delete link

Comments

For some reason Py39 wasn't installed with my PSSE v35, but 37 was, so after some playing around I got it to work. thanks!

tolemanator's avatar tolemanator (2022-08-31 07:10:12 -0500) edit
add a comment see more comments