LoginSignup
14
8

More than 3 years have passed since last update.

asdf で Python 3.9.1 + pipenv をインストールする

Last updated at Posted at 2020-12-29

Python のバージョン管理を、pyenv から asdf へお引っ越ししたので、再度 Python と pipenv をインストールしていきます。
パッケージ管理は pipenv が使いやすかったので引き続き使います。

前提

asdf をすでに導入している状態を前提とします。

インストールと確認

Python 3.9.1をインストールし、確認します。

インストール

shell
# プラグインをインストール
asdf plugin-add python

# インストール可能なバージョンの確認
asdf list-all python

# インストール
asdf install python 3.9.1

# 実体の確認
where python
/Users/USERNAME/.asdf/shims/python

asdf which python
/Users/USERNAME/.asdf/installs/python/3.9.1/bin/python

確認 & グローバルに設定

shell
# インストールを確認
asdf list python

# グローバルに設定 & shim 再生成
asdf global python 3.9.1
asdf reshim python

# シェルを再起動 / リロード

# バージョンの確認
python -V
Python 3.9.1

無事インストールできました🐈

pipenv

続けてpipenvをインストールする場合は以下です。

インストール

shell
# pip アップデート
pip install --upgrade pip

# pipenv インストール & shim 再生成
pip install pipenv
asdf reshim python

確認

shell
# バージョンの確認
pipenv --version
pipenv, version 2020.11.15

# 実体の確認
where pipenv
/Users/cray/.asdf/shims/pipenv

asdf which pipenv
/Users/USERNAME/.asdf/installs/python/3.9.1/bin/pipenv

無事インストールできました:cactus:


Source:
https://github.com/danhper/asdf-python

14
8
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
14
8