python geopandas TclError: не удается найти пригодный для использования файл init.tcl в следующих каталогах:

Пытался нарисовать что-то с помощью геопанд, а также пытался сделать аналогичное отображение с использованием боке, но столкнулся с той же ошибкой, потратил слишком много часов на гугление и, похоже, не может ее исправить.

Я работаю в Mac OS X 10.10.5 с ноутбуком ipython (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.

person Nate    schedule 13.12.2015    source источник
comment
Вы намеревались использовать venv поверх conda? Если вы используете conda, вы должны использовать их envs. Если вы не думаете, что используете анаконду, значит, ваши установки перечеркнуты.   -  person tacaswell    schedule 13.12.2015
comment
Что частично объясняет это, поскольку Tcl 8.5 (искомый anaconda) не является Tcl 8.4, установленным пользователем.   -  person schlenk    schedule 13.12.2015


Ответы (1)


Чтобы закрыть это, это была проблема пути. Я удалил анаконду, и, похоже, все прояснилось. Спасибо tcaswell за подсказку.

person Nate    schedule 26.12.2015