【问题标题】:How to install python 3.7.0 using pyenv?如何使用 pyenv 安装 python 3.7.0?
【发布时间】:2018-08-14 10:10:58
【问题描述】:

我尝试使用命令安装 “pyenv 安装 3.7.0” 并得到如下错误

Downloading Python-3.7.0.tar.xz...
-> https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
Installing Python-3.7.0...
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/pyenv/pyenv/wiki/Common-build-problems

BUILD FAILED (Ubuntu 14.04 using python-build 20180424)

我已经检查了https://github.com/pyenv/pyenv/wiki/Common-build-problems 的解决方案并尝试过

CFLAGS=-I/usr/include/openssl \
LDFLAGS=-L/usr/lib64 \
pyenv install -v 3.7.0

我再次面临与

相同的错误
The Python ssl extension was not compiled. Missing the OpenSSL lib?

还尝试安装低于 3.7 的 python 版本,所有这些都安装没有错误。我在这里缺少任何依赖包或版本更新。 我有openssl版本

OpenSSL 1.0.1f 6 Jan 2014

【问题讨论】:

    标签: python-3.x ubuntu-14.04 python-3.7 pyenv


    【解决方案1】:

    你可以先通过命令安装openssl@1.1来安装

        brew install 'openssl@1.1'
    

    您可以使用以下方法安装 python3.7:

        CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" pyenv install 3.7.0
    

    或者如果您不想为 openssl 安装任何特定版本,那么您可以使用以下命令来安装 openssl 包。

        CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.7.0
    

    【讨论】:

    • 你不能只使用brew install pythonbrew upgrade python 吗?我做到了,它似乎安装了依赖项 gdbm、openssl、sqlite。它目前是 python 3.7.2,所以这可能是以前的问题
    【解决方案2】:

    这里有没有我遗漏的依赖包或版本更新。

    是的,不幸的是有。 Python 3.7.0 需要 OpenSSL 1.0.2。我找不到比开发邮件列表更好的来源。到目前为止,我没有成功让 Python 3.7.0 在 Ubuntu 14.04 上运行,因为安装正确版本的 OpenSSL 并且不冲突一直是个技巧。

    Python 3.7:需要 OpenSSL >=1.0.2

    https://mail.python.org/pipermail/python-dev/2018-January/151718.html

    【讨论】:

      猜你喜欢
      • 2022-08-16
      • 1970-01-01
      • 2018-02-14
      • 2020-08-23
      • 2018-12-13
      • 2021-05-05
      • 1970-01-01
      • 1970-01-01
      • 2019-04-28
      相关资源
      最近更新 更多