更新运行 centos/whm 的服务器中的 python?

发布于 2025-01-08 17:50:25 字数 216 浏览 0 评论 0原文

我有一台运行带有 cpanel/whm 的 CentOS 的服务器。否则,这几乎是一个标准设置。

我的问题是这样的服务器正在运行 python 2.4,而我需要 python 2.6 或更高版本。如何在不破坏任何东西的情况下升级?

顺便说一句,我目前在该服务器上运行着一个 django 应用程序,我也想在不破坏它的情况下迁移到 python 2.6。我还需要做些什么才能做到这一点吗?

I have a server which is running CentOS with cpanel/whm. Otherwise, it is pretty much a standard set up.

My problem is that such server is running python 2.4 and I need python 2.6 or later. How do I upgrade without breaking anything?

By the way, I currently have a django application running on that server, which I would also like to move to python 2.6 without breaking it. Is there anything extra that I have to do to do that?

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

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

发布评论

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

评论(4

晒暮凉 2025-01-15 17:50:25

您必须并行安装新的Python。

如果你尝试更新默认的 Python,它会彻底破坏你的系统。

最简单的事情是使用众多 RPM 之一安装更新版本人们就是为了解决这个问题而建造的。

无论您做什么,不要尝试从源代码安装它。

You have to do a parallel install of the new Python.

If you try and update the default Python it will break your system completely.

The simplest thing is to install a newer version using one of the many RPMs that people have built to solve just this problem.

Whatever you do, do not try and install it from source.

作业与我同在 2025-01-15 17:50:25

我总是使用 pythonbrew 部署 python 应用程序,它允许您轻松安装和在多个 python 之间切换,而无需触摸系统Python。

Pythonbrew 从源代码编译,这确实需要您有一个编译器和正确的库和文件。安装了标头。您可以在此处查看您需要的内容:逐步安装 pythonbrew(适用于基于 debian 的系统)

I always deploy python applications with pythonbrew, which allows you to easily install and switch between several pythons without having to touch the system python.

Pythonbrew compiles from source, which does require you to have a compiler and the correct libraries & headers installed. You can look at which you need here: Step by step pythonbrew installation (for debian based systems)

奈何桥上唱咆哮 2025-01-15 17:50:25

您可以从源代码安装任何版本的 python,只要不覆盖 /usr/bin 中 cPanel 的 python 2.4 安装即可。为此,请在为构建配置 python 2.x 或 python 3.x 源时使用 -prefix= 选项。

You can install any version of python from source as long as you don't overwrite cPanel's python 2.4 installation at /usr/bin. To do this, use the -prefix= option when you configure the python 2.x or python 3.x source for build.

独木成林 2025-01-15 17:50:25

安装 Python 替代版本的最简单方法是下载源代码并编译它。当您运行完 ./configuremake 后,您将需要使用 make altinstall 进行安装,对于 python 2.6,您将结束使用名为 python26 的解释器

The simplest way to install an alternate version of Python is to download the source and compile it. When you've finished running ./configure and make, you'll want to install using make altinstall, with python 2.6 you'd end up with an interpreter named python26

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