Python 2.7 Virtualenv:TclError可以';找不到可用的init.tcl
问题:在报告和讨论的Windows虚拟环境中运行Python的Python 2.7 Virtualenv:TclError可以';找不到可用的init.tcl,python-2.7,matplotlib,tkinter,tcl,virtualenv,Python 2.7,Matplotlib,Tkinter,Tcl,Virtualenv,问题:在报告和讨论的Windows虚拟环境中运行Python的matplotib,以及相关的建议修复 代码(myp.py): Tcl错误: _tkinter.TclError: Can't find a usable init.tcl in the following directories: C:/Python27/lib/tcl8.5 C:/Users/Remi/MyVirtEnv/lib/tcl8.5....(ect) 修复尝试1:正如上面票证中所建议的,我添加了以下环境。批处理文件
matplotib
,以及相关的建议修复
代码(myp.py
):
Tcl错误:
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
C:/Python27/lib/tcl8.5 C:/Users/Remi/MyVirtEnv/lib/tcl8.5....(ect)
修复尝试1:正如上面票证中所建议的,我添加了以下环境。批处理文件activate.bat中路径的变量位于C:/Users/Remi/MyVirtEnv/Scripts/
:
set "TCL_LIBRARY=C:\Python27\tcl\tcl8.5"
set "TK_LIBRARY=C:\Python27\tcl\tk8.5"
不是这样解决的。潜在相关信息:使用具有以下配置的PyCharm
IDE:
Environment variables: PYTHONUNBUFFERED=1
Python interpreter: python 2.7.10 virtualenv at C:\Users\Remi\MyVirtEnv
"buttons checked": Add content roots and Add source roots to PYTHONPATH
如果我能得到任何帮助,我将不胜感激 在它列出的任何目录中都有init.tcl
吗?@Donal:yep在/Python27/tcl/tcl8.5
中。顺便说一句,目前最难看的修复方法是将/tk8.5
和/tcl8.5
复制到'C:\Users\Remi\MyVirtEnv\Lib`@Remi上。你找到了什么优雅的解决方案吗?我也有同样的问题。@tomab:不太可能。上面为我修复了它,我没有回头看。问题是有什么东西导致libtcl.dll
无法找到关联的init.tcl
。出现这种情况的原因有很多,但大多数原因归结为人们在移动安装的一部分时没有移动其余部分,或者在TCL_库
环境变量中使用了错误的值。我对此有一个长期的解决方案——包括构建一个组合安装文件——但仍在alpha中。
Environment variables: PYTHONUNBUFFERED=1
Python interpreter: python 2.7.10 virtualenv at C:\Users\Remi\MyVirtEnv
"buttons checked": Add content roots and Add source roots to PYTHONPATH