Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyenv won't build new python version (hangs)

I followed the tutorial from Northwestern to install pyenv and it seems the commands work. But when I run

pyenv install 3.7.0

(or whatever version) it just hangs. I get:

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

I have run tail -F /tmp/python-build.somenumber.log and get

/tmp/python-build.numbers.number ~/Path
/tmp/python-build.numbers.number/Python-3.7.0 /tmp/python-build.numbers.number ~/path

until I kill the install. Then the log file has

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

Testing on another build version everything looked the same the tail of the log file looks different

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

Maybe it just takes that long, but I ran both of these over 15 hrs each and so I assume something is going very wrong. I can't find a good SO or other post where someone else is experiencing this problem. Any advice?

$ 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

Doubt it'll be the difference, but I'm running zsh.

Edit: Have tried in bash as well. Placing the export functions in ~/.bash_profile and ~/.bashrc with no success. I didn't think these would be the errors since I can call the program just fine and that's all these exports are doing, but I can't figure out what the two commenters are trying to suggest by linking different documentations.

Edit 2: Running with verbose mode I still see nothing after the Installing line

like image 341
Steven Walton Avatar asked Apr 15 '19 20:04

Steven Walton


People also ask

Does Pyenv compile Python?

python-build is a pyenv plugin that provides a pyenv install command to compile and install different versions of Python on UNIX-like systems. You can also use python-build without pyenv in environments where you need precise control over Python version installation.

Where does Pyenv store Python versions?

Each Python version is installed into its own directory under $(pyenv root)/versions . For example, you might have these versions installed: $(pyenv root)/versions/2.7.8/ $(pyenv root)/versions/3.4.2/

How long should Python take to install?

Conclusion. We saw how easy it is to set up an environment for you to install Python on your computer. It does not take more than 5 minutes in the best case. In case if you face any issues, please post in the comments section.


1 Answers

It seems there is some bug. If I hit ctrl-C (once!) it starts building, and successfully works. Will submit bug report.

like image 81
Steven Walton Avatar answered Sep 28 '22 02:09

Steven Walton