Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install latest python version with pyenv

With ruby-install, to install the latest stable ruby version, one needs only ruby-install ruby.

However, with pyenv one seems to need to do something ridiculous like pyenv install $(pyenv install --list | sed 's/^ //' | grep '^\d' | grep --invert-match 'dev\|a\|b' | tail -1).

Is there a better way to do this? Why do python tools seem to always make installing the latest version such an obtuse process compared to ruby (gem update vs pip list --outdated | awk '!/Could not|ignored/ { print $1 }' | xargs pip install --upgrade)? I hope I’m the one missing something, but I can never find easy solutions for this online.

like image 315
user137369 Avatar asked Apr 16 '15 22:04

user137369


People also ask

What version of Python do I have Pyenv?

You can use either pyenv -v or pyenv --version to get the version of pyenv itself. Version comes up as the first command.

How do I install the latest version of Python Mac?

To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac. If it doesn't, click the macOS link and choose the latest Python release.

How do I install a new version of Python?

Install that version using "make install". Install all other versions using "make altinstall". For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being the primary version, you would execute "make install" in your 2.6 build directory and "make altinstall" in the others.


1 Answers

Try https://github.com/momo-lab/pyenv-install-latest

Installation...

git clone https://github.com/momo-lab/pyenv-install-latest.git "$(pyenv root)"/plugins/pyenv-install-latest

Latest 2.7 build of python...

pyenv install-latest 2.7

and for python 3...

pyenv install-latest

like image 185
Dave Avatar answered Sep 22 '22 14:09

Dave