tkFileDialog -> ImportError: No module named shell

A

Alan G Isaac

Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac



Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "boot_com_servers.py", line 44, in <module>
File "tbzr.pyo", line 125, in <module>
File "tbzr.pyo", line 60, in get_all_com_classes
File "contextmenu.pyo", line 9, in <module>
ImportError: No module named shell
Redirecting output to win32trace remote collector
 
M

Mike Driscoll

Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac

Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import Tkinter as tk
 >>> root=tk.Tk()
 >>> import tkFileDialog
 >>> fh = tkFileDialog.asksaveasfile()
Traceback (most recent call last):
   File "boot_com_servers.py", line 44, in <module>
   File "tbzr.pyo", line 125, in <module>
   File "tbzr.pyo", line 60, in get_all_com_classes
   File "contextmenu.pyo", line 9, in <module>
ImportError: No module named shell
Redirecting output to win32trace remote collector

Well, if you have tortoisehg installed, uninstall it. That was what
was giving me this exact error with wxPython file dialogs.

Mike
 
A

Alan G Isaac

Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC
v.1310 32 bit (Intel)] on win32 Type "help", "copyright",
"credits" or "license" for more information.
import Tkinter as tk
root=tk.Tk()
import tkFileDialog
fh = tkFileDialog.asksaveasfile()
Traceback (most recent call last):
File "boot_com_servers.py", line 44, in <module>
File "tbzr.pyo", line 125, in <module>
File "tbzr.pyo", line 60, in get_all_com_classes
File "contextmenu.pyo", line 9, in <module>
ImportError: No module named shell
Redirecting output to win32trace remote collector



Well, if you have tortoisehg installed, uninstall it. That was what
was giving me this exact error with wxPython file dialogs. [/QUOTE]



No, I don't have tortoisehg.
But, I do have Bazaar installed,
and that is the only place I see contextmenu.pyo.

And that appears to be the source of the problem:
https://bugs.launchpad.net/bzr/+bug/305085

Can you help me understand how
another application can interfere with Tkinter
in such a fashion?

Thank you!
Alan Isaac
 
M

Mike Driscoll

Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC
v.1310 32 bit (Intel)] on win32 Type "help", "copyright",
"credits" or "license" for more information.
 >>> import Tkinter as tk
 >>> root=tk.Tk()
 >>> import tkFileDialog
 >>> fh = tkFileDialog.asksaveasfile()
Traceback (most recent call last):
   File "boot_com_servers.py", line 44, in <module>
   File "tbzr.pyo", line 125, in <module>
   File "tbzr.pyo", line 60, in get_all_com_classes
   File "contextmenu.pyo", line 9, in <module>
ImportError: No module named shell
Redirecting output to win32trace remote collector

Well, if you have tortoisehg installed, uninstall it. That was what
was giving me this exact error with wxPython file dialogs.

No, I don't have tortoisehg.
But, I do have Bazaar installed,
and that is the only place I see contextmenu.pyo.

And that appears to be the source of the problem:https://bugs.launchpad.net/bzr/+bug/305085

Can you help me understand how
another application can interfere with Tkinter
in such a fashion?

Thank you!
Alan Isaac

Here's my (probably flawed) understanding of what tortoisehg does:
According to their bug report, there's a dll mismatch that causes the
issue (see http://bitbucket.org/tortoisehg/stable/issue/67/thg-conflicts-with-other-python).

I haven't had any issues with IDLE and bzr as of yet, and it
definitely hasn't given my Wingware IDE any issues either. I wonder if
you need to just upgrade to the latest bzr to see if that fixes the
issue. I have a pretty old one (1.8)...then again, I'm using wxPython,
not Tkinter.

Anyway, somehow these DVCSes are messing with the shell itself, which
is what a file dialog tries to open too. When the file dialog goes to
open it, it executes some code automagically in the DVCS and then
crashes.

Hopefully someone else with more knowledge will step in and give us a
clue.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top