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

pyenv won't build new python version (hangs)

我按照 tutorial from Northwestern 安装了 pyenv,命令似乎有效。但是当我 运行

pyenv install 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...

我有 运行 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

直到我终止安装。然后日志文件有

$ 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... %   

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

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

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

$ 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

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

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

编辑 2: 运行 详细模式在 Installing 行后我仍然什么都看不到

似乎有一些错误。如果我按 ctrl-C(一次!),它就会开始构建并成功运行。将提交错误报告。

你确定你的系统上安装了所有的构建依赖吗?如果不是 运行 以下 :

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