LoginSignup
4
2

More than 1 year has passed since last update.

AWS Cloud9のPythonバージョンを3.8.10に更新

Last updated at Posted at 2021-06-18

2021/06/18時点でCloud9を利用するとデフォルトでPython3.7.9が入っていました。
これを3.8.10に更新していきます。

pyenvを取得します。

# pyenvをGitHubから取得
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# pyenvのバージョンを確認
~/.pyenv/bin/pyenv --version

~/.bash_profileに以下を追加し、pyenvのパス設定と設定を行います。

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init --path)"
fi

~/.bash_profileの変更を反映し、バージョンを確認。

source ~/.bashrc
pyenv --version

インストール可能なPythonバージョンを確認しインストール。
今回は3.8.10をインストールします。

pyenv install -l | grep 3.8.
pyenv install 3.8.10

Python3.8.10に切替。

pyenv versions
pyenv global 3.8.10

pipを最新バージョンにアップデートします。

python -m pip install --upgrade pip

Python/pipのバージョンを確認

python -V
python -m pip -V

以上

4
2
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
4
2