The common regular python file dialog from Tk crashes under Enthought Canopy.
What is the recommended way to get a file dialog for Canopy users?
The code below works fine for regular python:
import Tkinter, tkFileDialog
root = Tkinter.Tk()
root.withdraw()
file_path = tkFileDialog.askopenfilename()
Error msg when run under Canopy is:
2014-12-30 11:22:52.809 Python[51980:d0f] -[QNSApplication _setup:]: unrecognized selector sent to instance 0x108657b70
Depends on what GUI backend you are using in your program. If your program also uses TK elsewhere, then follow the instructions in the link that Warren provided. If all you need is this dialog (and similar), Chuck's suggestion is probably easiest (especially since Qt is the default backend for IPython kernel that Canopy uses). I'm no Qt guru but I think you can simplify Chuck's suggestion to:
from PySide import QtGui
fname, _ = QtGui.QFileDialog.getOpenFileName(None, 'Choose file','.')
See http://srinikom.github.io/pyside-docs/PySide/QtGui/QFileDialog.html