anaconda bug?

George Trojan george.trojan at noaa.gov
Mon Mar 16 19:14:44 EDT 2015


I am not sure it is just me or there is a bug in anaconda. I installed 
miniconda from http://conda.pydata.org/miniconda.html, then several 
python3.4.3 packages. Then created virtual environment. When I switch to 
that environment I can not create tk root window. Here is the traceback:

(venv-3.4.3) $ python
Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar  6 2015, 12:03:53)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
 >>> import tkinter
 >>> tkinter.Tk()
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/gtrojan/miniconda3/lib/python3.4/tkinter/__init__.py", 
line 1851, in __init__
     self.tk = _tkinter.create(screenName, baseName, className, 
interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following 
directories:
     /opt/anaconda1anaconda2anaconda3/lib/tcl8.5 
/home/gtrojan/venv-3.4.3/lib/tcl8.5 /home/gtrojan/lib/tcl8.5 
/home/gtrojan/venv-3.4.3/library /home/gtrojan/library 
/home/gtrojan/tcl8.5.18/library /home/tcl8.5.18/library

It looks like the search path for tcl/tk libraries is messed up. The 
same command works fine when I exit virtual environment though. I do not 
have a problem with python 3.4.2 built from source on the same system.

For a workaround, I set TCL_LIBRARY and TK_LIBRARY in activate:

# bug in anaconda?
_OLD_TCL_LIBRARY="$TCL_LIBRARY"
TCL_LIBRARY="/home/gtrojan/miniconda3/lib/tcl8.5"
export TCL_LIBRARY
_OLD_TK_LIBRARY="$TK_LIBRARY"
TK_LIBRARY="/home/gtrojan/miniconda3/lib/tk8.5"
export TK_LIBRARY

I have found somewhat similar bug report: 
https://github.com/conda/conda/issues/348.

George






More information about the Python-list mailing list