Ask Your Question
0

ImportError: DLL load failed: %1 is not a valid Win32 application.

asked 2021-05-13 12:11:22 -0500

maryam gravatar image

updated 2021-05-13 12:17:22 -0500

I have used the following code to import psspy(my psse is PSSE 35), however I have got the following error:

import os, sys
sys_path_PSSE = r'C:\Program Files\PTI\PSSE35\35.2\PSSPY27'  # or where else you find the psspy.pyc
sys.path.append(sys_path_PSSE)
os_path_PSSE = r'C:\Program Files\PTI\PSSE35\35.2\PSSBIN'  # or where else you find the psse.exe
os.environ['PATH'] = ';' + os_path_PSSE

The error:

import psspy
File ".\psspy.py", line 56, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.

could you help me with that? Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2021-05-13 17:09:42 -0500

jconto gravatar image

Having a (v.35.2.1) install on default folders, I can load psspy with the following:

import psse35
import psspy

The error "ImportError: DLL load failed:" suggest a re-install.

edit flag offensive delete link more

Comments

Thank you @jconto. That problem was solved, but now I have "python load failed with error code 126" error for running the psse from python.

maryam gravatar imagemaryam ( 2021-05-13 17:25:05 -0500 )edit

I wanted to put the code here, but it seems that the length exceeds the maximum length.

maryam gravatar imagemaryam ( 2021-05-13 17:27:32 -0500 )edit

Any 'python load failed' error messages is usually related to bad installation. I can review your code if sent to jconto@ieee.org

jconto gravatar imagejconto ( 2021-05-14 13:00:35 -0500 )edit
0

answered 2021-05-21 02:15:33 -0500

breeze2021 gravatar image

you can install a 32-bit python.

edit flag offensive delete link more

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: 2021-05-13 12:11:22 -0500

Seen: 120 times

Last updated: May 21