0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pyenvでバージョン一覧表示したときに上から10個のバージョンのみをインストールする

0
Last updated at Posted at 2020-05-23

実現したいこと

pyenv で pyenv install -lした際に上位10個のバージョンのみをインストールする
ただし、*-devやa5などは、除外する

% pyenv install -l | grep -E "\s3." | sort -nr | head -15
  3.9.0a5
  3.9-dev
  3.8.2
  3.8.1
  3.8.0
  3.8-dev
  3.7.7
  3.7.6
  3.7.5
  3.7.4
  3.7.3
  3.7.2
  3.7.1
  3.7.0
  3.7-dev
% 

実行コマンド

pyenv install -l | grep -E "\s3.[0-9.]+$" | sort -nr | head -10 | xargs -I{} pyenv install {}

補足

% pyenv install -l | grep -E "\s3.[0-9.]+$" | sort -nr | head -10
  3.8.2
  3.8.1
  3.8.0
  3.7.7
  3.7.6
  3.7.5
  3.7.4
  3.7.3
  3.7.2
  3.7.1
%
% pyenv install -l | grep -E "\s3." | sort -nr | head -50
  3.9.0a5
  3.9-dev
  3.8.2
  3.8.1
  3.8.0
  3.8-dev
  3.7.7
  3.7.6
  3.7.5
  3.7.4
  3.7.3
  3.7.2
  3.7.1
  3.7.0
  3.7-dev
  3.6.9
  3.6.8
  3.6.7
  3.6.6
  3.6.5
  3.6.4
  3.6.3
  3.6.2
  3.6.10
  3.6.1
  3.6.0
  3.6-dev
  3.5.9
  3.5.8
  3.5.7
  3.5.6
  3.5.5
  3.5.4
  3.5.3
  3.5.2
  3.5.1
  3.5.0
  3.5-dev
  3.4.9
  3.4.8
  3.4.7
  3.4.6
  3.4.5
  3.4.4
  3.4.3
  3.4.2
  3.4.10
  3.4.1
  3.4.0
  3.4-dev
% 

上位10個ではなく、要件に応じて一つ一つ必要なバージョンのpythonをインストールするのが良いと思います。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?