First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

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

asked May 13 '1

maryam gravatar image

updated May 13 '1

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

2 answers

Sort by » oldest newest most voted
0

answered May 21 '1

breeze2021 gravatar image

you can install a 32-bit python.

link
0

answered May 13 '1

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.

link

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 (May 13 '1)

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

maryam gravatar imagemaryam (May 13 '1)

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 (May 14 '1)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: May 13 '1

Seen: 1,084 times

Last updated: May 21 '21