pyenv 不会构建新的 python 版本(挂起)

Ste*_*ton 5 python pyenv ubuntu-16.04

我按照Northwestern教程安装 pyenv ,看起来命令有效。但是当我跑

pyenv install 3.7.0
Run Code Online (Sandbox Code Playgroud)

(或任何版本)它只是挂起。我得到:

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...
Run Code Online (Sandbox Code Playgroud)

我已经运行tail -F /tmp/python-build.somenumber.log并得到

/tmp/python-build.numbers.number ~/Path
/tmp/python-build.numbers.number/Python-3.7.0 /tmp/python-build.numbers.number ~/path
Run Code Online (Sandbox Code Playgroud)

直到我杀死安装。然后日志文件有

$ tail -n 20 /tmp/python-build.numbers.log
checking for ieeefp.h... no
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking process.h usability... no
checking process.h presence... no
checking for process.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking shadow.h usability... %   
Run Code Online (Sandbox Code Playgroud)

在另一个构建版本上测试一切看起来都一样日志文件的尾部看起来不同

checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for --with-pydebug... no
checking for --with-assertions... no
checking for --enable-optimizations... no
checking for --with-lto... no
checking target system type... x86_64-pc-linux-gnu
checking for -llvm-profdata... no
checking for llvm-profdata... ''
checking for -Wextra... yes
checking whether gcc accepts and needs -fno-strict-aliasing... no
checking if we can turn off gcc unused result warning... yes
checking if we can turn off gcc unused parameter warning... yes
checking if we can turn off gcc missing field initializers warning... yes
checking if we can turn off gcc invalid function cast warning... no
checking if we can turn on gcc mixed sign comparison warning... yes
checking if we can turn on gcc unreachable code warning... no
checking if we can turn on gcc strict-prototypes warning... no
checking if we can make implicit function declaration an error in gcc... yes
checking whether pthreads are available without options... %  
Run Code Online (Sandbox Code Playgroud)

也许只需要那么长时间,但我都运行了这两个超过 15 小时,所以我认为有些地方出了问题。我找不到其他人遇到此问题的好 SO 或其他帖子。有什么建议吗?

$ uname -a
Linux foo 4.15.0-47-generic #50~16.04.1-Ubuntu SMP Fri Mar 15 16:06:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

怀疑这会有所不同,但我正在运行 zsh。

编辑:也尝试过 bash。将导出功能放入~/.bash_profile~/.bashrc没有成功。我不认为这些会是错误,因为我可以很好地调用程序,这就是所有这些导出正在做的事情,但我无法弄清楚这两个评论者试图通过链接不同的文档来提出什么建议。

编辑 2:以详细模式运行我在安装行之后仍然看不到任何东西

Ste*_*ton 9

好像有什么bug。如果我按下 ctrl-C (一次!),它就会开始构建,并成功运行。将提交错误报告。


WaL*_*oui 5

您确定您的系统上安装了所有构建依赖项吗?如果没有运行以下命令:

sudo apt-get install 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

删除旧版本: rm -rvf ~/.pyenv/versions/3.7.0

然后再次运行: pyenv install -v 3.7.0