Ask Your Question
1

PSEEv33 Import Tkinter problem

asked 2012-07-20 00:50:47 -0500

anonymous user

Anonymous

updated 2012-08-07 01:54:38 -0500

JervisW gravatar image

Hey guys,

I am new to PSEE and I am also new to this website. I appreciate it if someone can give me some insights of a strange issue I came across with PSEEv33

I had a "macro" python code which is developed by someone else for PSEEv32 and it works fine. Recently I switched to a new windows 7 machine and have PSEEv33 installed. However, running this python marco gives me import errors. I found that running this marco in PSSEv33 raised a problem when I import the Tkinter module (where it said:

""" import _tkinter ImportError: DLL load failed: The specified procedure could not be found. """

The strange thing is that there is no problem if I run a python file which imports this Tkinter module in the python shell separately.

Because the python marco I had contained works fine with PSEEv32, I do not want to convert it into an alternative python file which runs under the system python shell.

Anyone has an idea what has gone wrong? Thank you so much.

edit retag flag offensive close merge delete

Comments

Do you only have PSSEv33 installed? And did you install Python2.7 separately or just the one that came with PSSE? The error looks like Python is getting confused and cannot locate (where on your computer) the library that does pop up boxes (tkinter) is

JervisW gravatar imageJervisW ( 2012-07-20 03:16:46 -0500 )edit

Hi JervisW, I only have PSSEv33 installed. And I have tried to install Python2.7 which comes with PSSEv33 as well as The version I downloaded from the official python website separately. Both generates me the same problem.

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 07:33:34 -0500 )edit

However, I do not have the same problem when I install PSSEv32 with python2.5 on my windows 7 machine.

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 07:34:05 -0500 )edit

Hi PPS, can you send the results of this command? `import sys;print sys.path` Run from *inside* PSSE. it shows the directories where Python looks for libraries.

JervisW gravatar imageJervisW ( 2012-07-20 16:34:16 -0500 )edit

I save a .py file which includes the following lines import sys print sys.version print sys.executable print sys.path

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 19:53:27 -0500 )edit

When I run this script inside PSSEv33, it gvies: 2.7 (r27:82500, Feb 15 2011, 10:12:26) [MSC v.1600 32 bit (Intel)] C:\Program Files (x86)\PTI\PSSEUniversity33\PSSBIN\psse33.exe

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 19:54:11 -0500 )edit

'C:\\Users\\jeff\\Desktop', 'C:\\Program Files (x86)\\PTI\\PSSEUniversity33\\PSSBIN\\python27.zip', 'C:\\Python27\\Lib', 'C:\\Python27\\DLLs', 'C:\\Python27\\Lib\\lib-tk', 'C:\\Program Files (x86)\\PTI\\PSSEUniversity33\\Example', 'C:\\Program Files (x86)\\PTI\\PSSEUniversity33\\PSSBIN',

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 19:56:26 -0500 )edit

'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Program Files (x86)\\PTI\\PSSEUniversity33\\PSSBIN'];

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 19:56:52 -0500 )edit
1

It is almost identical to the system path if I run the script in the python shell. However, when I run a script which contain a line "import Tkinter" inside PSSEv33, it just throws me the DLL not found error. But I have no problem to run this script inside the python shell

PPS Newbie gravatar imagePPS Newbie ( 2012-07-20 20:00:04 -0500 )edit

In Python, the order of that `sys.path` variable is very important. When you run `import tkinter` it looks at the first folder and keeps moving to the last until it finds the module. Perhaps that earlier PSSBIN module is interfering with the later `c:\python27` modules?

JervisW gravatar imageJervisW ( 2012-07-22 11:59:47 -0500 )edit

Hi Jervis, that was a good point. But I compared the order of the import module to that of PSSEv32 and they are pretty much the same. Do you have v33?? If so, can you just created an automate file with one line of code: "import Tkinter" and run it in v33 and see if you have the same error as mine?

PPS Newbie gravatar imagePPS Newbie ( 2012-07-22 15:18:19 -0500 )edit

Sorry I don't have a copy of 33. @chip have you ever seen something like this?

JervisW gravatar imageJervisW ( 2012-07-23 02:19:33 -0500 )edit
1

This has been almost a year, and recently I found that PTI has fixed this problem with PSSEv33.4 The embedded python was complied in a way that doesnt point to the proper python path in the previous release.

PPS Newbie gravatar imagePPS Newbie ( 2013-06-02 01:57:04 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2013-06-02 01:49:28 -0500

PPS Newbie gravatar image

It been some time since I asked this question. And I just want share the update to ppl who may came across the same problem in the future. This is a known problem in prior to PSSEv33.4. PSSEv33.4 fixed this problem. Thanks.

edit flag offensive delete link more
0

answered 2022-10-08 08:08:13 -0500

Vlad gravatar image

I have this problem in psse 33.4. Please help

import Tkinter

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\Lib\lib-tk\Tkinter.py", line 38, in <module>
    import FixTk
  File "C:\Python27\Lib\lib-tk\FixTk.py", line 65, in <module>
    import _tkinter
ImportError: DLL load failed: The specified module could not be found.

Python Exception raised!
edit flag offensive delete link more
0

answered 2012-08-01 08:42:01 -0500

Most likely you miss the MSVCP71.DLL and msvcr71.dll in you windows\syswow64-folder.

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

2 followers

Stats

Asked: 2012-07-20 00:50:47 -0500

Seen: 1,146 times

Last updated: Oct 08 '22