python geopandas TclError: Can't find a usable init.tcl in the following directories:

python geopandas TclError: Can't find a usable init.tcl in the following directories:

尝试使用 geopandas 绘制一些东西并且还尝试使用散景进行类似的映射,但是 运行 进入相同的错误花了太多时间谷歌搜索并且似乎无法修复它。

我 运行 Mac OS X 10.10.5 运行 ipython notebook (python 2.7.10)一个虚拟环境。我已经在系统上安装了 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.

要关闭它,这是一个路径问题。我卸载了 anaconda,它似乎清理了一切。感谢 tcaswell 的提示。