在没有安装 gcc 的情况下安装 python 2.7

Install python 2.7 with no gcc installed

我有一台装有 python 2.6 的 CentOS 6.5 服务器和更新内核的限制。我需要将 django 1.8 项目的 virtualenv 配置为 运行.

只要 django 1.8 至少可以与 python 2.7 一起使用,我也需要安装它。安装 python 需要 gcc 编译 python 二进制文件。当我尝试使用 yum install gcc 安装 gcc 时,出现以下错误:

Error: Package: glibc-headers-2.12-1.166.el6_7.3.x86_64 (updates)
       Requires: kernel-headers >= 2.2.1
Error: Package: glibc-headers-2.12-1.166.el6_7.3.x86_64 (updates)
       Requires: kernel-headers

有没有其他方法可以在不使用 gcc 且不更新内核的情况下安装 python?其他软性要求做不到

谢谢。

在另一台计算机上安装兼容的 CentOS 6.5。安装所有必要的软件包以开发 Python 2.7.

在那里编译Python。

将编译好的树复制到原服务器

运行 make install.