Ask Your Question
0

Problem importing wx in PSSE

asked 2015-09-30 05:48:04 -0500

Gusimurrvl gravatar image

updated 2015-09-30 05:50:35 -0500

Hello! I've been running Python on top and got no problems with running my script and importing wx in it when running from my IDE or directly with python.exe. The connection with PSSE runs without any problem after psseinit().

Now I've realised that I've got to have PSSE on top because of a number of reasons, one of which is that I need my program working with the current PSSE working case and not a saved *.SAV-file because I don't want to have to save my working case every time before i press "Run Automation File" and run my script again.

As I try to run my script with PSSE on top by "Run Automation File" it errors when I'm trying to import the wx module.

While searching for what causes the problem I tried importing wx immedietly from within PSSE with output as seen below (or in this link Output)

import math, csv, numpy, matplotlib, psspy, wx

Traceback (most recent call last): (Output from PSSE Output Bar) (wx is the only module with error)

File "<string>", line 1, in <module>
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in <module>
from wx._core import *
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: Did not find the specified module.

I'm running PSSE Version 33.4.0 with 32bit Python on a Windows 7 computer.

The wx version in my Python27-folder is wx-2.8-msw-unicode Version '2.8.11.0'.

In the PSSE folder another wx folder lies under path C:\Program Files (x86)\PTI\PSSE33\PSSPY27\wx with version '2.8.12.0'. PSSE doesnt seem to be linked to using this wx-module but the one in the Python27 folder as seen in the output above.

What I've already tried to problem solve: I've tried to import wx in PSSE on two different collegues computers in my office with the same error message in PSSE appearing.

I've tried downloading msvcr90.dll and placing it in the wx folder (some guy on a forum said something about doing it). New error message:

File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
      import _core_
ImportError: DLL load failed: Initialization of a DLL-file failed.

I've tried moving the C:\Program Files (x86)\PTI\PSSE33\PSSPY27\wx to C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx with new error message from PSSE:

  File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
       import _core_
  ImportError: DLL load failed: Did not find the specified procedure.

Any Ideas?

What can I do to be able to run wx with PSSE on top. How can i make this import work?

If you try to import wx within your PSSE, does it work? What if you try to import cmath? My PSSE gets error message respectively crashes!!

Any ideas on which DLL might be ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-10-08 07:15:18 -0500

Running your code in PSSE 33.5 gave a similar DLL error: NumPy could not load one of its DLLs. Changing the import order(import psspy first) solved this problem for me:

import psspy, wx, math, csv, numpy, matplotlib
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

Stats

Asked: 2015-09-30 05:48:04 -0500

Seen: 2,369 times

Last updated: Oct 08 '15