我花了几个小时试图找到如何解决这个问题,但我还没有找到任何有用的东西。所以我试着用cx_Freeze把一个tkinter程序转换成exe。在我尝试打开实际的可执行文件之前,一切都运行正常。
我的设置文件:
import os
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
os.environ['TCL_LIBRARY'] = r"C:\Users\Osbo
我正在尝试编译一个程序(python2.7),但是无论我做什么,我总是得到这个错误:
C:/Python27/tcl/tk8.5/tk.tcl: version conflict for package "Tk": have 8.5.2, need exactly 8.5.15
version conflict for package "Tk": have 8.5.2, need exactly 8.5.15
while executing
"package require -exact Tk 8.5.15"
(file "C:
当我尝试将.py文件转换为可执行文件时,在命令提示符中出现以下错误:
[Errno 2] No such file or directory: 'C:\\Program Files\\Python35\\tcl\\tcl8.6'
下面是我的setup.py文件代码:
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = "C:\\Program Files\\Python35\\tcl\\tcl8.6"
os.environ['TK_L
我想使用Perl读取模块链接到的Tcl版本的版本。我发现下面的东西很好用
use strict;
use warnings;
use Tcl::pTk;
my $int = new Tcl::pTk;
$int->Eval(<<'EOS');
# pure-tcl code to create widgets (e.g. generated by some GUI builder)
text .e
## http://wiki.tcl.tk/1626#tk_version
.e insert end "tcl_version $tcl_
几天后,我回到我的电脑上,注意到我的绘图脚本不再工作,尽管没有对绘图代码或计算机库进行任何更改。我决定调查一下,中的示例脚本不再有效,并抛出了这个错误
objc[34475]: Class TKApplication is implemented in both /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk and /Library/Frameworks/Tk.framework/Versions/8.6/Tk. One of the two will be used. Which one is undefined.
objc[
通过pyenv安装的Python版本无法导入tkinter
※ python
Python 3.8.1 (default, Feb 29 2020, 11:45:59)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
F
我用的是macOS 10.12.1塞拉。我使用的是Python2.7.12
brew install python
但游手好闲的人发出警告
WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.
果然,它经常坠毁。8.5.9是macOS预装版本。
我可以从网站下载稳定的8.5.18 (这是推荐的,它与来自python.org的python安装一起工作(因为他们在求助于不稳定的mac