Ask Your Question

tolemanator's profile - activity

2022-08-31 07:10:12 -0600 commented answer Import psse35, dll fail

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!

2022-08-30 19:31:46 -0600 received badge  Famous Question (source)
2022-08-25 09:29:25 -0600 received badge  Notable Question (source)
2022-08-24 18:54:40 -0600 received badge  Popular Question (source)
2022-08-23 13:17:35 -0600 asked a question 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...

2022-08-23 12:55:11 -0600 commented question Open PSSE35.0 in Python3.7

did you figure this one out? I have the same issue

2022-08-23 07:58:06 -0600 received badge  Popular Question (source)
2022-08-22 11:50:54 -0600 received badge  Editor (source)
2022-08-22 10:28:53 -0600 asked a question Initialize PSSE35 with python- bad magic number and dll module not found

I am trying to use python to script things in PSSE v35. The initialization code I have for v34 works and when mirroring for v35, I get a bad magic number error.

This works for v34, there are install files for 2.7, 3.4, 3.7, and 3.9 (using 3.9 as the interpreter) in the C:\Program Files (x86)\PTI\PSSE34 root:

sys.path.append('C:\Program Files (x86)\PTI\PSSE34\PSSPY39')

This not working for v35, there are install files for 2.7, 3.7, and 3.8 in the C:\Program Files\PTI\PSSE35\35.2 root:

sys.path.append(r'C:\Program Files\PTI\PSSE35\35.2\PSSPY38')

The error: Traceback (most recent call last): File "C:\Users\nxt0v07\OneDrive - NEE\Python\Model builder\idv_app.py", line 175, in <module> import psse35 File "C:\Program Files\PTI\PSSE35\35.2\PSSPY38\psse35.py", line 27, in <module> import os, psseloc ImportError: bad magic number in 'psseloc': b'U\r\r\n'

I was running the v34 script with python 39 but I downloaded and got 3.8, and now it's throwing "DLL load failed while importing psscommon: %1 is not a valid Win32 application." even though the 3.8 version I have is 32 bit. I now have switched to 64 bit which seems to have solved the Win32 error, but now it's looking for a file that doesn't seem to exist:

Traceback (most recent call last): File "C:/Users/nxt0v07/OneDrive - NEE/Python/Model builder/psse35test.py", line 152, 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.

2022-07-27 17:55:34 -0600 received badge  Famous Question (source)
2022-06-12 19:41:43 -0600 received badge  Notable Question (source)
2022-06-11 14:03:48 -0600 received badge  Popular Question (source)
2022-06-10 05:59:40 -0600 commented answer Pass variables through python API functions?

I was doing that yesterday and for some reason it wasn't working then, but it is now! and yes I'm in pycharm. Thank you!

2022-06-10 05:59:19 -0600 answered a question Pass variables through python API functions?

I was doing that yesterday and for some reason it wasn't working then, but it is now! and yes I'm in pycharm. Thank you!!

2022-06-09 12:13:48 -0600 asked a question Pass variables through python API functions?

I'm trying to do something like: ierr = psspy.solutionparameters4([100, FDNSiter, 40, 100, 10],[1.6, 1.6, 1.0, 0.0001, FDNSaccn, FDNStoln, 1.0, 0.00001, FDNSbln, 0.7, 0.0001, 0.005, 1.0, 0.05, 0.99, 0.99, 0.1, 0.00001, 100.0])

It seems to be rejecting the variables I pass through like "FDNS_iter" even though I force the variable to be an integer type. It consistently throw an error of "Type Error: must be a real number, not a str" so somehow defining the variable as an integer isn't be recognized so I'm wondering if the PSSE API isn't able to pass variables through functions period.

2022-02-16 00:24:46 -0600 received badge  Famous Question (source)
2022-02-11 13:47:50 -0600 commented answer PSSE output not always going to directed output file

I think I figured out the problem and it was not initializing the output file before starting to write to it, and sometimes it wouldn't find the file if it wasn't created quickly enough and then would default to the terminal. thanks for your help!

2022-02-11 03:19:22 -0600 received badge  Notable Question (source)
2022-02-10 18:23:57 -0600 received badge  Popular Question (source)
2022-02-07 09:43:51 -0600 asked a question PSSE output not always going to directed output file

I am writing a script to batch build models and I have the solve log info (via progress_output) going to a text file output instead of the python terminal. Sometimes, without a reason I can determine, the output shows up in the terminal but then other times it gets redirected as intended. Any ideas?