在 SLES 11 上安装 Python 2.7 [英] Installing Python 2.7 on SLES 11

查看:60
本文介绍了在 SLES 11 上安装 Python 2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人能够在 SLES 11 SP1 上成功安装 Python 2.7?如果是这样,如何?我尝试了几种安装方法如下:

Has anyone been able to successfully install Python 2.7 on SLES 11 SP1? If so, how? I have tried several methods to install as follows:

  1. 尝试从源代码构建 - 结果证明这非常乏味,超出了我的耐心和技能水平.
  2. 尝试使用 PythonBrew,但由于错误而放弃.
  3. 尝试从 OpenSuse 11 存储库安装 RPM,但由于依赖性问题无法完成.

推荐答案

从源代码构建是最合适的答案.您的耐心将带来可观的回报.

Building from source is the most appropriate answer. Your patience will pay significant dividends.

像下面这样的脚本就足够了(信用):

A script like the following should be sufficient (credit):

#!/bin/bash
# Install Python 2.7.12 alternatively
zypper install -t pattern sdk_c_c++ -y
zypper install readline-devel openssl-devel gmp-devel ncurses-devel gdbm-devel zlib-devel expat-devel libGL-devel tk tix gcc-c++ libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel valgrind-devel -y

mkdir tmp
cd tmp
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
tar xvfz Python-2.7.12.tgz
cd Python-2.7.12
./configure --prefix=/opt/python2.7 --enable-shared
make
make altinstall
echo "/opt/python2.7/lib" >> /etc/ld.so.conf.d/opt-python2.7.conf
ldconfig
cd ..
cd ..
rm -rf tmp

...如果您遇到有关证书链的错误并且您确信您的流量没有被拦截,您可以使用 --no-check-certificate 命令行选项<代码>wget.这可能是必要的,因为 SLES11 已经足够老了,它的 openssl 库可能不支持 python.org 的网络服务器所期望的 TLS 功能.如果您使用该选项,请根据 https://www.python 检查 tarball 的签名.org/downloads/release/python-2712/(如有必要,请使用非 SLES11 浏览器).

...if you encounter errors regarding the certificate chain and you have confidence that your traffic is not being intercepted, you could use the --no-check-certificate command-line option for wget. It may be necessary because SLES11 is old enough that its openssl library may not support TLS features expected by python.org's webserver. If you use that option, please check the tarball's signature against https://www.python.org/downloads/release/python-2712/ (using a non-SLES11 browser if necessary).

这篇关于在 SLES 11 上安装 Python 2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆