繁体   English   中英

使用pyenv安装Python 3.11.1的问题

[英]Problems with installing Python 3.11.1 using pyenv

我尝试使用 Pyenv 安装 Python 3.11.1 并得到了这个:

➜  ~ pyenv install 3.11.1 
Downloading Python-3.11.1.tar.xz...
-> https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz
Installing Python-3.11.1...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/eustignos/.pyenv/versions/3.11.1/lib/python3.11/ssl.py", line 100, in <module>
    import _ssl             # if we can't import it, let the error propagate
    ^^^^^^^^^^^
ModuleNotFoundError: No module named '_ssl'
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 22.10 using python-build 20180424)

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

Last 10 log lines:
        LD_LIBRARY_PATH=/tmp/python-build.20230112175103.128449/Python-3.11.1 ./python -E -m ensurepip \
                $ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpba6xv1b0
Processing /tmp/tmpba6xv1b0/setuptools-65.5.0-py3-none-any.whl
Processing /tmp/tmpba6xv1b0/pip-22.3.1-py3-none-any.whl
Installing collected packages: setuptools, pip
  WARNING: The scripts pip3 and pip3.11 are installed in '/home/{user}/.pyenv/versions/3.11.1/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.3.1 setuptools-65.5.0

OpenSSL 以 2 种不同的方式安装(使用 apt - latest for 22.10 and 2 with brew - 1.1 and 3)默认情况下:

➜  ~ openssl version
OpenSSL 1.1.1s  1 Nov 2022
➜  ~ which openssl
/home/linuxbrew/.linuxbrew/bin/openssl

以这种方式解决:

➜  ~ CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.11.1

并得到相同的消息,但对于 tkinter lib。 安装这个

➜  ~ brew install tcl-tk

一切都很好:

➜  ~ CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.11.1
Downloading Python-3.11.1.tar.xz...
-> https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz
Installing Python-3.11.1...
Installed Python-3.11.1 to /home/eustignos/.pyenv/versions/3.11.1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM