Ask Your Question
0

Import psse35, dll fail

asked 2022-08-23 13:17:35 -0500

tolemanator gravatar image

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...

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2022-08-30 14:46:30 -0500

juancaquesada gravatar image

updated 2022-08-30 17:58:03 -0500

jconto gravatar image

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()

"

edit flag offensive delete link more

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 gravatar imagetolemanator ( 2022-08-31 07:10:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2022-08-23 13:17:35 -0500

Seen: 950 times

Last updated: Aug 30 '22