在 Suse Linux Server 11.3 上安装 Python 2.7.2 找不到 tkinter 依赖项

发布于 2024-12-23 03:04:19 字数 929 浏览 2 评论 0原文

我花了几个小时在这上面。看起来我们在 Linux 上的工作是调试那些在分散的发行版中不起作用的脚本,而不是完成工作。

setup.py 尝试找到它需要的东西,并构建用于包装某些依赖项的 C 模块(如果它能找到它需要的东西)。这使得脚本相对于路径和文件名来说非常脆弱。

虽然很难从 .py 源中看出,但对于 tkinter 来说,我们似乎需要 tcl、tk 和 tix。这些的最新版本都已安装。我可以验证这一点,因为 SUSE 发行版附带的 Python 2.6 导入了_tkinter 和 Tkinter 模块并正确运行测试脚本。

该脚本似乎需要找到库。我安装了32位和64位。所以,这些库存在: 32位 64位 libtk8.5.so /usr/lib /usr/lib64 libtcl8.5.so " "

两个路径都包含在 Setup.py 中相应的搜索列表中。但是,我不认为 setup.py 会搜索正确的文件名。它似乎搜索以 tk 和 tcl 开头的文件,连接各种不同的版本(包括“8.5”)。但是,文件名不以“lib”开头。在我开始进行更多篡改之前,Python.org 的人们真的会把事情搞得这么严重吗?这似乎不太可能。 SUSE Linux 是一个如此奇怪的发行版吗?这似乎也不太可能。

我不认为 setup.py 会查找二进制文件(在运行时看起来很重要......),但它们存在于 usr/lib 和 usr/lib64 中。

我能找到的唯一包含文件是 tclextend。它是在 usr/include 中找到的 tclextend.h。我找不到 tcl 或 tk 的其他 .h 文件。当然,Python c 包装器所需的包含文件随 Python 2.7 的下载提供。

所以,我有点无计可施了。这是对时间的巨大浪费。有没有办法跳过构建过程并仅构建 tcl/tk 支持?我对 ssl 也有同样的问题:它无法构建。一次只做一件事。

感谢您的帮助。

I've spent hours on this. Seems like our job on Linux is to debug scripts that don't work across the fragmented distros rather than getting work done.

Setup.py tries to find what it needs and build the c modules used to wrap certain dependencies if it can find what it needs. This makes the script super fragile relative to paths and file names.

While it is VERY hard to tell from the .py source, it seems for tkinter we need tcl, tk, and tix. Latest versions of these are all installed. I can verify this because Python 2.6 that comes with the SUSE distro imports_tkinter and Tkinter modules and runs the test script correctly.

The script seems to need to find the libraries. I have both 32 bit and 64 bit installed. So, these libraries exist:
32bit 64bit
libtk8.5.so /usr/lib /usr/lib64
libtcl8.5.so " "

Both paths are included in the appropriate search list in Setup.py. But, I don't think Setup.py searches for the correct file names. It seems to search for files that begin with tk and tcl, catenating a variety of different versions (including '8.5'). But, the file names don't begin with 'lib'. Before I begin tampering more, could the Python.org folks have really messed this up so badly? That doesn't seem likely. Is SUSE Linux so odd a distro? This doesn't seem likely either.

I don't think setup.py would look for the binaries (would matter at run time it would seem...) but they are present in usr/lib and usr/lib64.

The only include file I can find is for tclextend. It is tclextend.h found in usr/include. I could not find other .h files for tcl or tk. Of course the include files that the Python c wrappers require are supplied with the download of Python 2.7.

So, I am kind of at my wit's end. This is such a colossal waste of time. Is there a way to just skip the build process and just build the tcl/tk support? I also have the same problem with ssl: it would not build. One thing at a time.

Thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十年九夏 2024-12-30 03:04:19

我发现了许多 rpm 包集的分发点。这使我能够安装单独的软件包,例如 tcl 的标头。但是,这是一个糟糕的方法,因为为 tkinter 构建 Python 支持的完整依赖层次结构大约有 60 个包。

我发现操作系统 11.3 版的 OpenSuSE 存储库包含了我需要的一切。我的 Novell 发行版附带了 Novell 的存储库,其中几乎排除了所有开发包。

问题解决了。 python 的 make 找到了 tkinter 的所有先决条件。

很抱歉发布这样的问题。

I found many distribution points for sets of rpm packages. This enabled me to install individual packages such as the headers for tcl. But, this was a bad approach because the full dependency hierarchy to build Python support for tkinter is something on the order of 60 packages.

I found that the OpenSuSE repository for version 11.3 of the OS contained everything I needed. My Novell distro came with Novell's repositories which exclude nearly all devel packages.

Problem solved. The make of python found all of the prerequisites for tkinter.

Sorry to post such a nube question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文