Installing Python 2.7 on SLES 11

前端 未结 1 1791
故里飘歌
故里飘歌 2021-02-01 23:40

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. Tried building from sourc
1条回答
  •  情话喂你
    2021-02-02 00:35

    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
    

    ...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).

    0 讨论(0)
提交回复
热议问题