错误:缺少OpenSSL库?同时尝试在pyenv / SUSE12环境中安装python

时间:2016-08-01 14:18:01

标签: python linux opensuse pyenv

我已经尝试在pyenv env中安装python,其中我收到以下错误。我已经将openssl添加到路径变量中,因为openssl已经可用,但它仍然会抛出相同的错误。

此外,现在尝试使用单独的用户(不是root用户)。同样的错误!并尝试跟进维基页面,但对于OpenSUSE我也无法在谷歌上找到太多帮助。

有人可以指导我如何继续这样做。

 xxxxx@xxxxxxxxxxx:~/.pyenv> pyenv install 3.5.2
    Downloading Python-3.5.2.tar.xz...
    -> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
    Installing Python-3.5.2...
    WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
    WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
    ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

    Please consult to the Wiki page to fix the problem.
    https://github.com/yyuu/pyenv/wiki/Common-build-problems


    BUILD FAILED (SLES 12.1 using python-build 20160726)

    Inspect or clean up the working tree at /tmp/python-build.20160801100205.31144
    Results logged to /tmp/python-build.20160801100205.31144.log

    Last 10 log lines:
    (cd /home/xxxxx/.pyenv/versions/3.5.2/share/man/man1; ln -s python3.5.1 python3.1)
    if test "xupgrade" != "xno"  ; then \
            case upgrade in \
                    upgrade) ensurepip="--upgrade" ;; \
                    install|*) ensurepip="" ;; \
            esac; \
             ./python -E -m ensurepip \
                    $ensurepip --root=/ ; \
    fi
    Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS

5 个答案:

答案 0 :(得分:3)

除了上述答案,我还得:

sudo apt-get install python-openssl

答案 1 :(得分:2)

Python利用底层操作系统库来支持它的一些库,看起来你没有安装这些库。在Ubuntu上,您应该可以使用

安装它们
$ sudo apt-get install bzip2 libreadline6 libreadline6-dev openssl

对于SUSE 12,正如您所指出的,所需的命令是

zypper -n install openssl libopenssl-devel

答案 2 :(得分:1)

sudo apt install libssl1.0-dev帮助我

答案 3 :(得分:1)

这里https://github.com/pyenv/pyenv/wiki/common-build-problems

有用于解决构建问题的官方指南。

因此对于openSuse,您必须首先使用以下命令安装依赖项:

zypper in zlib-devel bzip2 libbz2-devel libffi-devel libopenssl-devel \
readline-devel sqlite3 sqlite3-devel xz xz-devel

对于Ubuntu / Debian也是如此:

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

答案 4 :(得分:0)

对我来说,以上内容在Ubuntu 18.04上都无效,我拥有openssl和openssl-dev以及python-openssl,但它可以与openssl1.0-dev一起使用,

$ sudo apt-get install openssl1.0-dev