KeyError: #39;TCL_Library#39; when I use cx_Freeze(KeyError: TCL_Library 当我使用 cx_Freeze)
问题描述
When I use cx_Freeze
I get a keyerror KeyError: 'TCL_Library'
while building my pygame program. Why do I get this and how do I fix it?
My setup.py is below:
from cx_Freeze import setup, Executable
setup(
name = "Snakes and Ladders",
version = "0.9",
author = "Adam",
author_email = "Omitted",
options = {"build_exe": {"packages":["pygame"],
"include_files": ["main.py", "squares.py",
"pictures/Base Dice.png", "pictures/Dice 1.png",
"pictures/Dice 2.png", "pictures/Dice 3.png",
"pictures/Dice 4.png", "pictures/Dice 5.png",
"pictures/Dice 6.png"]}},
executables = [Executable("run.py")],
)
You can work around this error by setting the environment variables manually:
set TCL_LIBRARY=C:Program FilesPython35-32 cl cl8.6
set TK_LIBRARY=C:Program FilesPython35-32 cl k8.6
You can also do that in the setup.py
script:
os.environ['TCL_LIBRARY'] = r'C:Program FilesPython35-32 cl cl8.6'
os.environ['TK_LIBRARY'] = r'C:Program FilesPython35-32 cl k8.6'
setup([..])
But I found that actually running the program doesn't work. On the cx_freeze mailinglist it was mentioned:
I have looked into it already and no, it is not just a simple recompile -- or it would have been done already! :-)
It is in progress and it looks like it will take a bit of effort. Some of the code in place to handle things like extension modules inside packages is falling over -- and that may be better solved by dropping that code and forcing the package outside the zip file (another pull request that needs to be absorbed). I should have some time next week and the week following to look into this further. So all things working out well I should put out a new version of cx_Freeze before the end of the year.
But perhaps you have more luck ... Here's the bug report.
这篇关于KeyError: 'TCL_Library' 当我使用 cx_Freeze的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:KeyError: 'TCL_Library' 当我使用 cx_Freeze
基础教程推荐
- 哪些 Python 包提供独立的事件系统? 2022-01-01
- 将 YAML 文件转换为 python dict 2022-01-01
- 使用Python匹配Stata加权xtil命令的确定方法? 2022-01-01
- 合并具有多索引的两个数据帧 2022-01-01
- 如何在Python中绘制多元函数? 2022-01-01
- 使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage 2022-01-01
- 使 Python 脚本在 Windows 上运行而不指定“.py";延期 2022-01-01
- Python 的 List 是如何实现的? 2022-01-01
- 如何在 Python 中检测文件是否为二进制(非文本)文 2022-01-01
- 症状类型错误:无法确定关系的真值 2022-01-01