0

geopandas を使用して何かをプロットしようとしており、bokeh を使用して同様のマッピングを実行しようとしていましたが、同じエラーが発生し、グーグルで何時間もかけて修正できなかったようです。

virtualenvでipythonノートブック(python 2.7.10)を実行しているMac OS X 10.10.5で実行しています。システムに ActiveTLC 8.6.4 をインストールしました。私は困惑しています

import geopandas as gp`
from matplotlib import pyplot

df = gp.read_file('TM_WORLD_BORDERS_SIMPL-0.3.shp')
df.plot()

---------------------------------------------------------------------------
TclError                                  Traceback (most recent call last)
<ipython-input-16-4f76bcc16520> in <module>()
----> 1 df.plot()

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/geopandas/geodataframe.pyc in plot(self, *args, **kwargs)
    379 
    380     def plot(self, *args, **kwargs):
--> 381         return plot_dataframe(self, *args, **kwargs)
    382 
    383 def _dataframe_set_geometry(self, col, drop=False, inplace=False, crs=None):

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/geopandas/plotting.pyc in plot_dataframe(s, column, colormap, alpha, categorical, legend, axes, scheme, k)
    178 
    179     if column is None:
--> 180         return plot_series(s.geometry, colormap=colormap, alpha=alpha, axes=axes)
    181     else:
    182         if s[column].dtype is np.dtype('O'):

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/geopandas/plotting.pyc in plot_series(s, colormap, alpha, axes)
    103     import matplotlib.pyplot as plt
    104     if axes == None:
--> 105         fig = plt.gcf()
    106         fig.add_subplot(111, aspect='equal')
    107         ax = plt.gca()

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/matplotlib/pyplot.pyc in gcf()
    576         return figManager.canvas.figure
    577     else:
--> 578         return figure()
    579 
    580 

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs)
    525                                         frameon=frameon,
    526                                         FigureClass=FigureClass,
--> 527                                         **kwargs)
    528 
    529         if figLabel:

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.pyc in new_figure_manager(num, *args, **kwargs)
     82     FigureClass = kwargs.pop('FigureClass', Figure)
     83     figure = FigureClass(*args, **kwargs)
---> 84     return new_figure_manager_given_figure(num, figure)
     85 
     86 

/Users/thisuser/.virtualenvs/geopandas/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.pyc in new_figure_manager_given_figure(num, figure)
     90     """
     91     _focus = windowing.FocusManager()
---> 92     window = Tk.Tk()
     93     window.withdraw()
     94 

/Users/thisuser/anaconda/lib/python2.7/lib-tk/Tkinter.pyc in __init__(self, screenName, baseName, className, useTk, sync, use)
   1812                 baseName = baseName + ext
   1813         interactive = 0
-> 1814         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
   1815         if useTk:
   1816             self._loadtk()

TclError: Can't find a usable init.tcl in the following directories: 
    /opt/anaconda1anaconda2anaconda3/lib/tcl8.5 /Users/thisuser/.virtualenvs/geopandas/lib/tcl8.5 /Users/thisuser/.virtualenvs/lib/tcl8.5 /Users/thisuser/.virtualenvs/geopandas/library /Users/thisuser/.virtualenvs/library /Users/thisuser/.virtualenvs/tcl8.5.18/library /Users/thisuser/tcl8.5.18/library



This probably means that Tcl wasn't installed properly.
4

1 に答える 1

1

これを閉じるには、パスの問題でした。anacondaをアンインストールしたところ、問題が解決したようです。ヒントをくれた tcaswell に感謝します。

于 2015-12-26T15:45:09.397 に答える