在ubuntu 14.04中使用kaggle教程的TclError:ipython,pylab和pandas

时间:2015-02-10 18:26:01

标签: python-2.7 ubuntu matplotlib kaggle

import pandas as pd
df = pd.read_csv('./csv/train.csv', header=0)
import pylab as P
df['Age'].hist()
P.show()

TclError                                  Traceback (most recent call last) <ipython-input-2-25fb4a5af439> in <module>()
      1 import pylab as P
----> 2 df['Age'].hist()
      3 P.show()

/usr/lib/python2.7/dist-packages/pandas/tools/plotting.pyc in hist_series(self, by, ax, grid, xlabelsize, xrot, ylabelsize, yrot, figsize, **kwds)    2134         # hack until the plotting interface is a bit more unified    2135         fig = kwds.pop('figure', plt.gcf() if plt.get_fignums() else
-> 2136                        plt.figure(figsize=figsize))    2137         if (figsize is not None and tuple(figsize) !=    2138             tuple(fig.get_size_inches())):

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs)
    421                                         frameon=frameon,
    422                                         FigureClass=FigureClass,
--> 423                                         **kwargs)
    424 
    425         if figLabel:

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.pyc in new_figure_manager(num, *args, **kwargs)
     77     FigureClass = kwargs.pop('FigureClass', Figure)
     78     figure = FigureClass(*args, **kwargs)
---> 79     return new_figure_manager_given_figure(num, figure)
     80 
     81 

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.pyc in new_figure_manager_given_figure(num, figure)
     85     """
     86     _focus = windowing.FocusManager()
---> 87     window = Tk.Tk()
     88     window.withdraw()
     89 

/usr/lib/python2.7/lib-tk/Tkinter.py in __init__(self, screenName, baseName, className, useTk, sync, use)    1765                 baseName = baseName + ext    1766         interactive = 0
-> 1767         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)    1768         if useTk:    1769             self._loadtk()

0 个答案:

没有答案