AIX 上的 Python:我有哪些选择?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1646293/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 22:47:47  来源:igfitidea点击:

Python on AIX: What are my options?

pythonaixncursescurses

提问by Enfors

I need to make some Python applications for a work project. The target platform is AIX 5.3.

我需要为一个工作项目制作一些 Python 应用程序。目标平台是 AIX 5.3。

My question is: What version of Python should I be using?

我的问题是:我应该使用什么版本的 Python?

My requirements are:

我的要求是:

  • The Python version must be easy to install on the target machines. Others will do that according to instructions that I write, so no compiling from source or anything like that.

  • The Python version must have ncurses or curses support (I'm making a form handler).

  • Python 版本必须易于安装在目标机器上。其他人会根据我写的说明来做,所以不要从源代码或类似的东西编译。

  • Python 版本必须有 ncurses 或 curses 支持(我正在制作一个表单处理程序)。

I've found two different precompiled versions of Python for AIX, but one (2.1.something) didn't include the curses module, and the other (2.3.4, RPM format) had prerequisites that I failed to fulfill).

我发现了两种不同的 AIX 预编译 Python 版本,但一种 (2.1.something) 不包含 curses 模块,而另一种(2.3.4,RPM 格式)具有我未能满足的先决条件。

Any help would be greatly appreciated.

任何帮助将不胜感激。

采纳答案by John La Rooy

I'd compile it from source myself and tell them where to download it from in the instructions

我会自己从源代码编译它,并在说明中告诉他们从哪里下载它

回答by Michael Dillon

Use the AS Package of Python 2.6.3.7 from Activestate. They have a binary package for AIX on their download site.

使用 Activestate 的 Python 2.6.3.7 的 AS 包。他们的下载站点上有 AIX 的二进制包。

If you don't have an AIX machine to test it on, the install works the same way on Solaris or Linux, so you could write your documentation based on that. Basically, you ungzip the tarball file, use tar to unpack the archive, change directory to the unpacked folder, run a shell script to install it, tell the shell script what directory to place it in, and wait.

如果您没有用于测试的 AIX 机器,则安装在 Solaris 或 Linux 上的工作方式相同,因此您可以基于此编写文档。基本上,您解压缩 tarball 文件,使用 tar 解压存档,将目录更改为解压后的文件夹,运行 shell 脚本进行安装,告诉 shell 脚本将其放置在哪个目录中,然后等待。

Normally this would be used to install into a user directory, without superuser permissions, but you could install it anywhere that you like. You might also need to edit the system profile in order to make sure that all users can find the Python binary.

通常,这将用于安装到用户目录中,无需超级用户权限,但您可以将其安装在您喜欢的任何位置。您可能还需要编辑系统配置文件以确保所有用户都可以找到 Python 二进制文件。

I suggest the latest Python 2.6, because it has a lot of bugfixes, and there is now a critical mass of 3rd party libraries ported to it. Also, the standard library includes a lot of useful stuff that you used to have to collect separately. Curses is in the standard library of Python 2.6.

我建议使用最新的 Python 2.6,因为它有很多错误修正,并且现在有大量的 3rd 方库移植到它。此外,标准库包含许多您过去必须单独收集的有用内容。Curses 在 Python 2.6 的标准库中。

Make sure to avoid Python 3.1 since it has not yet matured enough and provides few benefits for most business applications development.

确保避免使用 Python 3.1,因为它还不够成熟,并且对大多数业务应用程序开发几乎没有什么好处。

回答by chauncey

We've used ActiveState's Python as well as Pware'scompiled version. Both have worked well. For AS, we've used 2.5 and 2.6. For Pware, just 2.6. Both 2.5 and 2.6 from AS support curses on our machine.

我们使用了 ActiveState 的 Python 以及Pware 的编译版本。两者都运作良好。对于 AS,我们使用了 2.5 和 2.6。对于 Pware,只有 2.6。AS 的 2.5 和 2.6 都支持我们机器上的curses。

I've compiled from source but usually wind up having trouble with with ctypes or SSL. Currently I have the Frankenstein option going of AS Python2.6 installed but I pulled out a couple of *.so files from Pware's. I'm using GCC since we've never ponied up for a compiler but depending on what you need from Python, it's definitely doable if I can do it.

我是从源代码编译的,但通常会在使用 ctypes 或 SSL 时遇到问题。目前我已经安装了 AS Python2.6 的 Frankenstein 选项,但我从 Pware 中取出了几个 *.so 文件。我正在使用 GCC,因为我们从来没有考虑过编译器,但根据您对 Python 的需求,如果我能做到,这绝对是可行的。

I will mention that AS Python claims to be 100% compatible with standard Python and it has been for everything we've done so far (mostly web applications).

我要提到的是,AS Python 声称与标准 Python 100% 兼容,并且它一直适用于我们迄今为止所做的一切(主要是 Web 应用程序)。